diff --git a/README.md b/README.md index dc2e84d..2e3342e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Contents -------- **   ** **1. Collections:** ** ** **[`List`](#list)**__,__ **[`Dictionary`](#dictionary)**__,__ **[`Set`](#set)**__,__ **[`Tuple`](#tuple)**__,__ **[`Range`](#range)**__,__ **[`Enumerate`](#enumerate)**__,__ **[`Iterator`](#iterator)**__,__ **[`Generator`](#generator)**__.__ **   ** **2. Types:** **          ** **[`Type`](#type)**__,__ **[`String`](#string)**__,__ **[`Regular_Exp`](#regex)**__,__ **[`Format`](#format)**__,__ **[`Numbers`](#numbers-1)**__,__ **[`Combinatorics`](#combinatorics)**__,__ **[`Datetime`](#datetime)**__.__ -**   ** **3. Syntax:** **         ** **[`Args`](#arguments)**__,__ **[`Inline`](#inline)**__,__ **[`Import`](#imports)**__,__ **[`Decorator`](#decorator)**__,__ **[`Class`](#class)**__,__ **[`Duck_Types`](#duck-types)**__,__ **[`Enum`](#enum)**__,__ **[`Exception`](#exceptions)**__.__ +**   ** **3. Syntax:** **         ** **[`Function`](#function)**__,__ **[`Inline`](#inline)**__,__ **[`Import`](#imports)**__,__ **[`Decorator`](#decorator)**__,__ **[`Class`](#class)**__,__ **[`Duck_Type`](#duck-types)**__,__ **[`Enum`](#enum)**__,__ **[`Except`](#exceptions)**__.__ **   ** **4. System:** **        ** **[`Exit`](#exit)**__,__ **[`Print`](#print)**__,__ **[`Input`](#input)**__,__ **[`Command_Line_Arguments`](#command-line-arguments)**__,__ **[`Open`](#open)**__,__ **[`Path`](#paths)**__,__ **[`OS_Commands`](#os-commands)**__.__ **   ** **5. Data:** **             ** **[`JSON`](#json)**__,__ **[`Pickle`](#pickle)**__,__ **[`CSV`](#csv)**__,__ **[`SQLite`](#sqlite)**__,__ **[`Bytes`](#bytes)**__,__ **[`Struct`](#struct)**__,__ **[`Array`](#array)**__,__ **[`Memory_View`](#memory-view)**__,__ **[`Deque`](#deque)**__.__ **   ** **6. Advanced:** **   ** **[`Operator`](#operator)**__,__ **[`Match_Stmt`](#match-statement)**__,__ **[`Logging`](#logging)**__,__ **[`Introspection`](#introspection)**__,__ **[`Threading`](#threading)**__,__ **[`Coroutines`](#coroutines)**__.__ @@ -671,86 +671,72 @@ import zoneinfo, dateutil.tz ``` -Arguments ---------- -### Inside Function Call +Function +-------- +**Independent block of code that returns a value when called.** ```python -func() # func(0, 0) -func() # func(x=0, y=0) -func(, ) # func(0, y=0) +def (): ... # E.g. `def func(x, y): ...`. +def (): ... # E.g. `def func(x=0, y=0): ...`. +def (, ): ... # E.g. `def func(x, y=0): ...`. ``` +* **Function returns None if it doesn't encounter `'return '` statement.** +* **Before modifying a global variable from within the function run `'global '`.** +* **Default values are evaluated when function is first encountered in the scope. Any mutation of a mutable default value will persist between invocations!** + +### Function Call -### Inside Function Definition ```python -def func(): ... # def func(x, y): ... -def func(): ... # def func(x=0, y=0): ... -def func(, ): ... # def func(x, y=0): ... + = () # E.g. `func(0, 0)`. + = () # E.g. `func(x=0, y=0)`. + = (, ) # E.g. `func(0, y=0)`. ``` -* **Default values are evaluated when function is first encountered in the scope.** -* **Any mutation of a mutable default value will persist between invocations!** Splat Operator -------------- -### Inside Function Call **Splat expands a collection into positional arguments, while splatty-splat expands a dictionary into keyword arguments.** ```python -args = (1, 2) -kwargs = {'x': 3, 'y': 4, 'z': 5} +args, kwargs = (1, 2), {'z': 3} func(*args, **kwargs) ``` #### Is the same as: ```python -func(1, 2, x=3, y=4, z=5) +func(1, 2, z=3) ``` ### Inside Function Definition **Splat combines zero or more positional arguments into a tuple, while splatty-splat combines zero or more keyword arguments into a dictionary.** ```python -def add(*a): - return sum(a) -``` - -```python +>>> def add(*a): +... return sum(a) +... >>> add(1, 2, 3) 6 ``` -#### Legal argument combinations: -```python -def f(*args): ... # f(1, 2, 3) -def f(x, *args): ... # f(1, 2, 3) -def f(*args, z): ... # f(1, 2, z=3) -``` - -```python -def f(**kwargs): ... # f(x=1, y=2, z=3) -def f(x, **kwargs): ... # f(x=1, y=2, z=3) | f(1, y=2, z=3) -``` - +#### Allowed compositions of arguments inside function definition and the ways they can be called: ```python -def f(*args, **kwargs): ... # f(x=1, y=2, z=3) | f(1, y=2, z=3) | f(1, 2, z=3) | f(1, 2, 3) -def f(x, *args, **kwargs): ... # f(x=1, y=2, z=3) | f(1, y=2, z=3) | f(1, 2, z=3) | f(1, 2, 3) -def f(*args, y, **kwargs): ... # f(x=1, y=2, z=3) | f(1, y=2, z=3) -``` - -```python -def f(*, x, y, z): ... # f(x=1, y=2, z=3) -def f(x, *, y, z): ... # f(x=1, y=2, z=3) | f(1, y=2, z=3) -def f(x, y, *, z): ... # f(x=1, y=2, z=3) | f(1, y=2, z=3) | f(1, 2, z=3) ++--------------------+------------+--------------+----------------+------------------+ +| | f(1, 2, 3) | f(1, 2, z=3) | f(1, y=2, z=3) | f(x=1, y=2, z=3) | ++--------------------+------------+--------------+----------------+------------------+ +| f(x, *args, **kw): | yes | yes | yes | yes | +| f(*args, z, **kw): | | yes | yes | yes | +| f(x, **kw): | | | yes | yes | +| f(*, x, **kw): | | | | yes | ++--------------------+------------+--------------+----------------+------------------+ ``` ### Other Uses ```python - = [* [, ...]] # Or: list() [+ ...] - = (*, [...]) # Or: tuple() [+ ...] - = {* [, ...]} # Or: set() [| ...] - = {** [, ...]} # Or: | ... + = [* [, ...]] # Or: list() [+ ...] + = (*, [...]) # Or: tuple() [+ ...] + = {* [, ...]} # Or: set() [| ...] + = {** [, ...]} # Or: | ... ``` ```python -head, *body, tail = # Head or tail can be omitted. +head, *body, tail = # Head or tail can be omitted. ``` @@ -798,24 +784,32 @@ from functools import reduce ``` ```python ->>> [a if a else 'zero' for a in (0, 1, 2, 3)] # `any([0, '', [], None]) == False` +>>> [i if i else 'zero' for i in (0, 1, 2, 3)] # `any([0, '', [], None]) == False` ['zero', 1, 2, 3] ``` +### And, Or +```python + = and [and ...] # Returns first false or last operand. + = or [or ...] # Returns first true or last operand. +``` + +### Walrus Operator +```python +>>> [i for a in '0123' if (i := int(a)) > 0] # Assigns to variable mid-sentence. +[1, 2, 3] +``` + ### Named Tuple, Enum, Dataclass ```python from collections import namedtuple -Point = namedtuple('Point', 'x y') # Creates a tuple's subclass. +Point = namedtuple('Point', 'x y') # Creates tuple's subclass. point = Point(0, 0) # Returns its instance. -``` -```python from enum import Enum -Direction = Enum('Direction', 'N E S W') # Creates an enum. +Direction = Enum('Direction', 'N E S W') # Creates Enum's subclass. direction = Direction.N # Returns its member. -``` -```python from dataclasses import make_dataclass Player = make_dataclass('Player', ['loc', 'dir']) # Creates a class. player = Player(point, direction) # Returns its instance. diff --git a/index.html b/index.html index c7e8d10..a0dbf77 100644 --- a/index.html +++ b/index.html @@ -56,7 +56,7 @@
- +
@@ -94,7 +94,7 @@ const browser_prefers_dark = window.matchMedia('(prefers-color-scheme: dark)').m
ToC = {
     '1. Collections': [List, Dictionary, Set, Tuple, Range, Enumerate, Iterator, Generator],
     '2. Types':       [Type, String, Regular_Exp, Format, Numbers, Combinatorics, Datetime],
-    '3. Syntax':      [Args, Inline, Import, Decorator, Class, Duck_Types, Enum, Exception],
+    '3. Syntax':      [Function, Inline, Import, Decorator, Class, Duck_Type, Enum, Except],
     '4. System':      [Exit, Print, Input, Command_Line_Arguments, Open, Path, OS_Commands],
     '5. Data':        [JSON, Pickle, CSV, SQLite, Bytes, Struct, Array, Memory_View, Deque],
     '6. Advanced':    [Operator, Match_Stmt, Logging, Introspection, Threading, Coroutines],
@@ -598,62 +598,55 @@ Point(x=1, y=2
 <float>  = <TD>      / <TD>                 # Also `(<int>, <TD>) = divmod(<TD>, <TD>)`.
 
-

#Arguments

Inside Function Call

func(<positional_args>)                           # func(0, 0)
-func(<keyword_args>)                              # func(x=0, y=0)
-func(<positional_args>, <keyword_args>)           # func(0, y=0)
-
- - -

Inside Function Definition

def func(<nondefault_args>): ...                  # def func(x, y): ...
-def func(<default_args>): ...                     # def func(x=0, y=0): ...
-def func(<nondefault_args>, <default_args>): ...  # def func(x, y=0): ...
+

#Function

Independent block of code that returns a value when called.

def <func_name>(<nondefault_args>): ...                  # E.g. `def func(x, y): ...`.
+def <func_name>(<default_args>): ...                     # E.g. `def func(x=0, y=0): ...`.
+def <func_name>(<nondefault_args>, <default_args>): ...  # E.g. `def func(x, y=0): ...`.
 
+
    -
  • Default values are evaluated when function is first encountered in the scope.
  • -
  • Any mutation of a mutable default value will persist between invocations!
  • +
  • Function returns None if it doesn't encounter 'return <obj/exp>' statement.
  • +
  • Before modifying a global variable from within the function run 'global <var_name>'.
  • +
  • Default values are evaluated when function is first encountered in the scope. Any mutation of a mutable default value will persist between invocations!
-

#Splat Operator

Inside Function Call

Splat expands a collection into positional arguments, while splatty-splat expands a dictionary into keyword arguments.

args   = (1, 2)
-kwargs = {'x': 3, 'y': 4, 'z': 5}
-func(*args, **kwargs)
-
+

Function Call

<obj> = <function>(<positional_args>)                    # E.g. `func(0, 0)`.
+<obj> = <function>(<keyword_args>)                       # E.g. `func(x=0, y=0)`.
+<obj> = <function>(<positional_args>, <keyword_args>)    # E.g. `func(0, y=0)`.
+
+

#Splat Operator

Splat expands a collection into positional arguments, while splatty-splat expands a dictionary into keyword arguments.

args, kwargs = (1, 2), {'z': 3}
+func(*args, **kwargs)
+
-

Is the same as:

func(1, 2, x=3, y=4, z=5)
+

Is the same as:

func(1, 2, z=3)
 
-

Inside Function Definition

Splat combines zero or more positional arguments into a tuple, while splatty-splat combines zero or more keyword arguments into a dictionary.

def add(*a):
-    return sum(a)
+

Inside Function Definition

Splat combines zero or more positional arguments into a tuple, while splatty-splat combines zero or more keyword arguments into a dictionary.

>>> def add(*a):
+...     return sum(a)
+... 
+>>> add(1, 2, 3)
+6
 
-
>>> add(1, 2, 3)
-6
-
-

Legal argument combinations:

def f(*args): ...               # f(1, 2, 3)
-def f(x, *args): ...            # f(1, 2, 3)
-def f(*args, z): ...            # f(1, 2, z=3)
+

Allowed compositions of arguments inside function definition and the ways they can be called:

┏━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━┓
+┃                    │ f(1, 2, 3) │ f(1, 2, z=3) │ f(1, y=2, z=3) │ f(x=1, y=2, z=3) ┃
+┠────────────────────┼────────────┼──────────────┼────────────────┼──────────────────┨
+┃ f(x, *args, **kw): │      ✓     │      ✓       │        ✓       │        ✓         ┃
+┃ f(*args, z, **kw): │            │      ✓       │        ✓       │        ✓         ┃
+┃ f(x, **kw):        │            │              │        ✓       │        ✓         ┃
+┃ f(*, x, **kw):     │            │              │                │        ✓         ┃
+┗━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┛
 
-
def f(**kwargs): ...            # f(x=1, y=2, z=3)
-def f(x, **kwargs): ...         # f(x=1, y=2, z=3) | f(1, y=2, z=3)
-
-
def f(*args, **kwargs): ...     # f(x=1, y=2, z=3) | f(1, y=2, z=3) | f(1, 2, z=3) | f(1, 2, 3)
-def f(x, *args, **kwargs): ...  # f(x=1, y=2, z=3) | f(1, y=2, z=3) | f(1, 2, z=3) | f(1, 2, 3)
-def f(*args, y, **kwargs): ...  # f(x=1, y=2, z=3) | f(1, y=2, z=3)
-
-
def f(*, x, y, z): ...          # f(x=1, y=2, z=3)
-def f(x, *, y, z): ...          # f(x=1, y=2, z=3) | f(1, y=2, z=3)
-def f(x, y, *, z): ...          # f(x=1, y=2, z=3) | f(1, y=2, z=3) | f(1, 2, z=3)
-
-

Other Uses

<list>  = [*<coll.> [, ...]]    # Or: list(<collection>) [+ ...]
-<tuple> = (*<coll.>, [...])     # Or: tuple(<collection>) [+ ...]
-<set>   = {*<coll.> [, ...]}    # Or: set(<collection>) [| ...]
-<dict>  = {**<dict> [, ...]}    # Or: <dict> | ...
+

Other Uses

<list>  = [*<collection> [, ...]]  # Or: list(<collection>) [+ ...]
+<tuple> = (*<collection>, [...])   # Or: tuple(<collection>) [+ ...]
+<set>   = {*<collection> [, ...]}  # Or: set(<collection>) [| ...]
+<dict>  = {**<dict> [, ...]}       # Or: <dict> | ...
 
-
head, *body, tail = <coll.>     # Head or tail can be omitted.
+
head, *body, tail = <collection>   # Head or tail can be omitted.
 

#Inline

Lambda

<func> = lambda: <return_value>                     # A single statement function.
 <func> = lambda <arg_1>, <arg_2>: <return_value>    # Also allows default arguments.
@@ -683,22 +676,30 @@ func(*args, **kwargs)
 

Conditional Expression

<obj> = <exp> if <condition> else <exp>             # Only one expression is evaluated.
 
-
>>> [a if a else 'zero' for a in (0, 1, 2, 3)]      # `any([0, '', [], None]) == False`
+
>>> [i if i else 'zero' for i in (0, 1, 2, 3)]      # `any([0, '', [], None]) == False`
 ['zero', 1, 2, 3]
 
+

And, Or

<obj> = <exp> and <exp> [and ...]                   # Returns first false or last operand.
+<obj> = <exp> or <exp> [or ...]                     # Returns first true or last operand.
+
+ +

Walrus Operator

>>> [i for a in '0123' if (i := int(a)) > 0]        # Assigns to variable mid-sentence.
+[1, 2, 3]
+
+

Named Tuple, Enum, Dataclass

from collections import namedtuple
-Point = namedtuple('Point', 'x y')                  # Creates a tuple's subclass.
+Point = namedtuple('Point', 'x y')                  # Creates tuple's subclass.
 point = Point(0, 0)                                 # Returns its instance.
-
-
from enum import Enum
-Direction = Enum('Direction', 'N E S W')            # Creates an enum.
+from enum import Enum
+Direction = Enum('Direction', 'N E S W')            # Creates Enum's subclass.
 direction = Direction.N                             # Returns its member.
-
-
from dataclasses import make_dataclass
+
+from dataclasses import make_dataclass
 Player = make_dataclass('Player', ['loc', 'dir'])   # Creates a class.
 player = Player(point, direction)                   # Returns its instance.
-
+
+

#Imports

Mechanism that makes code in one file available to another file.

import <module>            # Imports a built-in or '<module>.py'.
 import <package>           # Imports a built-in or '<package>/__init__.py'.
 import <package>.<module>  # Imports a built-in or '<package>/<module>.py'.
@@ -2944,7 +2945,7 @@ $ deactivate                # Deactivates the active
  
 
   
 
diff --git a/parse.js b/parse.js
index 51a02ab..c83b9d4 100755
--- a/parse.js
+++ b/parse.js
@@ -33,7 +33,7 @@ const TOC =
   '
ToC = {\n' +
   '    \'1. Collections\': [List, Dictionary, Set, Tuple, Range, Enumerate, Iterator, Generator],\n' +
   '    \'2. Types\':       [Type, String, Regular_Exp, Format, Numbers, Combinatorics, Datetime],\n' +
-  '    \'3. Syntax\':      [Args, Inline, Import, Decorator, Class, Duck_Types, Enum, Exception],\n' +
+  '    \'3. Syntax\':      [Function, Inline, Import, Decorator, Class, Duck_Type, Enum, Except],\n' +
   '    \'4. System\':      [Exit, Print, Input, Command_Line_Arguments, Open, Path, OS_Commands],\n' +
   '    \'5. Data\':        [JSON, Pickle, CSV, SQLite, Bytes, Struct, Array, Memory_View, Deque],\n' +
   '    \'6. Advanced\':    [Operator, Match_Stmt, Logging, Introspection, Threading, Coroutines],\n' +
@@ -55,6 +55,13 @@ const CACHE =
   'def fib(n):\n' +
   '    return n if n < 2 else fib(n-2) + fib(n-1)';
 
+const SPLAT =
+  '>>> def add(*a):\n' +
+  '...     return sum(a)\n' +
+  '... \n' +
+  '>>> add(1, 2, 3)\n' +
+  '6\n';
+
 const PARAMETRIZED_DECORATOR =
   'from functools import wraps\n' +
   '\n' +
@@ -416,6 +423,19 @@ const DIAGRAM_5_A =
   "|              |  {:.2}  |  {:.2f} |  {:.2e} |  {:.2%} |\n" +
   "+--------------+----------------+----------------+----------------+----------------+\n";
 
+const DIAGRAM_55_A =
+  "+--------------------+------------+--------------+----------------+------------------+\n";
+
+const DIAGRAM_55_B =
+  '┏━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━┓\n' +
+  '┃                    │ f(1, 2, 3) │ f(1, 2, z=3) │ f(1, y=2, z=3) │ f(x=1, y=2, z=3) ┃\n' +
+  '┠────────────────────┼────────────┼──────────────┼────────────────┼──────────────────┨\n' +
+  '┃ f(x, *args, **kw): │      ✓     │      ✓       │        ✓       │        ✓         ┃\n' +
+  '┃ f(*args, z, **kw): │            │      ✓       │        ✓       │        ✓         ┃\n' +
+  '┃ f(x, **kw):        │            │              │        ✓       │        ✓         ┃\n' +
+  '┃ f(*, x, **kw):     │            │              │                │        ✓         ┃\n' +
+  '┗━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┛\n';
+
 const DIAGRAM_6_A =
   '+------------+------------+------------+------------+--------------+\n' +
   '|            |  Iterable  | Collection |  Sequence  | abc.Sequence |\n' +
@@ -690,7 +710,6 @@ const DIAGRAM_15_B =
   "┃                       │ c  .  .  6  7 │            │            │ treated as a column.      ┃\n" +
   "┗━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n";
 
-
 const DIAGRAM_16_A =
   '| df.apply(…)     |      x  4     |        x  y   |     x  4      |';
 
@@ -854,6 +873,7 @@ function updateDiagrams() {
   $(`code:contains(${DIAGRAM_2_A})`).html(DIAGRAM_2_B);
   $(`code:contains(${DIAGRAM_4_A})`).html(DIAGRAM_4_B);
   $(`code:contains(${DIAGRAM_5_A})`).parent().remove();
+  $(`code:contains(${DIAGRAM_55_A})`).html(DIAGRAM_55_B);
   $(`code:contains(${DIAGRAM_6_A})`).html(DIAGRAM_6_B);
   $(`code:contains(${DIAGRAM_7_A})`).html(DIAGRAM_7_B);
   $(`code:contains(${DIAGRAM_8_A})`).html(DIAGRAM_8_B);
@@ -904,18 +924,18 @@ function fixClasses() {
 function fixHighlights() {
   $(`code:contains( = ±0b)`).html(BIN_HEX);
   $(`code:contains( + fib(n)`).html(CACHE);
+  $(`code:contains(>>> def add)`).html(SPLAT);
   $(`code:contains(@debug(print_result=True))`).html(PARAMETRIZED_DECORATOR);
   $(`code:contains(print/str/repr([]))`).html(REPR_USE_CASES);
-  $(`code:contains((self, a=None):)`).html(CONSTRUCTOR_OVERLOADING);
   $(`code:contains(shutil.copy)`).html(SHUTIL_COPY);
   $(`code:contains(os.rename)`).html(OS_RENAME);
   $(`code:contains(\'s\')`).html(STRUCT_FORMAT);
   $(`code:contains(match :)`).html(MATCH);
   $(`code:contains(>>> match Path)`).html(MATCH_EXAMPLE);
+  $(`code:contains(>>> log.basicConfig()`).html(LOGGING_EXAMPLE);
   $(`code:contains(import asyncio, collections, curses, curses.textpad, enum, random)`).html(COROUTINES);
-  $(`code:contains(import curses, os)`).html(CURSES);
   $(`code:contains(pip3 install tqdm)`).html(PROGRESS_BAR);
-  $(`code:contains(>>> log.basicConfig()`).html(LOGGING_EXAMPLE);
+  $(`code:contains(import curses, os)`).html(CURSES);
   $(`code:contains(a_float = max()`).html(AUDIO_1);
   $(`code:contains(samples_f = (sin(i *)`).html(AUDIO_2);
   $(`code:contains(collections, dataclasses, enum, io, itertools)`).html(MARIO);
diff --git a/pdf/index_for_pdf.html b/pdf/index_for_pdf.html
index 735f3c2..5642d82 100644
--- a/pdf/index_for_pdf.html
+++ b/pdf/index_for_pdf.html
@@ -7,7 +7,7 @@
 

abstract base classes, 4, 19
animation, 40, 42-43
argparse module, 22
-arguments, 10, 12, 22
+arguments, 10, 12, 22
arrays, 29, 37-38
asyncio module, 33
audio, 40-41, 42

@@ -34,11 +34,11 @@ curses module, 33, 34
cython, 15, 49

D

-

dataclasses module, 12, 15
+

dataclasses module, 11, 15
datetime module, 8-9
decorator, 13, 14, 15, 16
deques, 29
-dictionaries, 2, 4, 11, 19, 21
+dictionaries, 2, 4, 10-11, 19, 21
duck types, 16-19

E

enum module, 19-20
@@ -64,7 +64,7 @@

I

image, 35, 39-40, 42-43
imports, 12
-inline, 11, 15, 20
+inline, 11, 15, 20
input function, 22
introspection, 21, 31
ints, 4, 7-8, 28
@@ -76,7 +76,7 @@

json, 25, 36, 46

L

lambda, 11
-lists, 1-2, 4, 11, 18-19, 21
+lists, 1-2, 4, 10-11, 18-19, 21
locale module, 16
logging, 31

M

@@ -121,11 +121,11 @@

scope, 10, 12, 20
scraping, 35, 43, 46, 47-48
sequence, 4, 18-19
-sets, 2, 4, 11, 19, 21
+sets, 2, 4, 10-11, 19, 21
shell commands, 25
sleep function, 34
sortable, 1, 16
-splat operator, 10-11, 26
+splat operator, 10, 26
sql, 27, 46
statistics, 7, 37-38, 44-48
strings, 4-7, 14
@@ -138,7 +138,7 @@ template, 6, 36
threading module, 32, 36
time module, 34, 36
-tuples, 3, 4, 11, 18-19
+tuples, 3, 4, 10-11, 18-19
type, 4, 16, 30
type annotations, 15, 31

W

diff --git a/pdf/index_for_pdf_print.html b/pdf/index_for_pdf_print.html index 5c20dd8..a27f676 100644 --- a/pdf/index_for_pdf_print.html +++ b/pdf/index_for_pdf_print.html @@ -34,11 +34,11 @@ curses module, 33, 34
cython, 15, 49

D

-

dataclasses module, 12, 15
+

dataclasses module, 11, 15
datetime module, 8-9
decorator, 13, 14, 15, 16
deques, 29
-dictionaries, 2, 4, 11, 19, 21
+dictionaries, 2, 4, 10-11, 19, 21
duck types, 16-19

E

enum module, 19-20
@@ -76,7 +76,7 @@

json, 25, 36, 46

L

lambda, 11
-lists, 1-2, 4, 11, 18-19, 21
+lists, 1-2, 4, 10-11, 18-19, 21
locale module, 16
logging, 31

M

@@ -121,11 +121,11 @@

scope, 10, 12, 20
scraping, 35, 43, 46, 47-48
sequence, 4, 18-19
-sets, 2, 4, 11, 19, 21
+sets, 2, 4, 10-11, 19, 21
shell commands, 25
sleep function, 34
sortable, 1, 16
-splat operator, 10-11, 26
+splat operator, 10, 26
sql, 27, 46
statistics, 7, 37-38, 44-48
strings, 4-7, 14
@@ -138,7 +138,7 @@ template, 6, 36
threading module, 32, 36
time module, 34, 36
-tuples, 3, 4, 11, 18-19
+tuples, 3, 4, 10-11, 18-19
type, 4, 16, 30
type annotations, 15, 31

W

diff --git a/web/script_2.js b/web/script_2.js index 12ff725..d0a46ac 100644 --- a/web/script_2.js +++ b/web/script_2.js @@ -2,7 +2,7 @@ const TOC = 'ToC = {\n' + ' \'1. Collections\': [List, Dictionary, Set, Tuple, Range, Enumerate, Iterator, Generator],\n' + ' \'2. Types\': [Type, String, Regular_Exp, Format, Numbers, Combinatorics, Datetime],\n' + - ' \'3. Syntax\': [Args, Inline, Import, Decorator, Class, Duck_Types, Enum, Exception],\n' + + ' \'3. Syntax\': [Function, Inline, Import, Decorator, Class, Duck_Type, Enum, Except],\n' + ' \'4. System\': [Exit, Print, Input, Command_Line_Arguments, Open, Path, OS_Commands],\n' + ' \'5. Data\': [JSON, Pickle, CSV, SQLite, Bytes, Struct, Array, Memory_View, Deque],\n' + ' \'6. Advanced\': [Operator, Match_Stmt, Logging, Introspection, Threading, Coroutines],\n' + @@ -18,7 +18,7 @@ const TOC_MOBILE = ' \'2. Types\': [Type, String, Regular_Exp,\n' + ' Format, Numbers,\n' + ' Combinatorics, Datetime],\n' + - ' \'3. Syntax\': [Arguments, Inline, Import,\n' + + ' \'3. Syntax\': [Function, Inline, Import,\n' + ' Decorator, Class,\n' + ' Duck_Types, Enum, Except],\n' + ' \'4. System\': [Exit, Print, Input,\n' +