diff --git a/README.md b/README.md index 9b893a7..48f59d1 100644 --- a/README.md +++ b/README.md @@ -620,7 +620,7 @@ from dateutil.tz import tzlocal, gettz =
.astimezone([]) # Converts DT to the passed or local fixed zone. = .replace(tzinfo=) # Changes object's timezone without conversion. ``` -* **Timezones returned by gettz(), tzlocal(), and implicit local timezone of naive objects have offsets that vary through time due to DST and historical changes of the zone's base offset.** +* **Timezones returned by tzlocal(), gettz(), and implicit local timezone of naive objects have offsets that vary through time due to DST and historical changes of the zone's base offset.** * **Standard library's zoneinfo.ZoneInfo() can be used instead of gettz() on Python 3.9 and later. It requires 'tzdata' package on Windows. It doesn't return local tz if arg. is omitted.** ### Encode @@ -2158,7 +2158,7 @@ with : # Enters the block by calling acq ``` * **Map() and as\_completed() also accept 'timeout'. It causes futures.TimeoutError when next() is called/blocking. Map() times from original call and as_completed() from first call to next(). As\_completed() fails if next() is called too late, even if thread finished on time.** * **Exceptions that happen inside threads are raised when next() is called on map's iterator or when result() is called on a Future. Its exception() method returns exception or None.** -* **ProcessPoolExecutor provides true parallelism but: everything sent to/from workers must be [pickable](#pickle), queues must be sent using executor's 'initargs' and 'initializer' parameters, and all executors should only be reachable via `'if __name__ == "__main__": ...'`.** +* **ProcessPoolExecutor provides true parallelism but: everything sent to/from workers must be [pickable](#pickle), queues must be sent using executor's 'initargs' and 'initializer' parameters, and executor should only be reachable via `'if __name__ == "__main__": ...'`.** Operator @@ -2184,7 +2184,7 @@ product_of_elems = functools.reduce(op.mul, ) first_element = op.methodcaller('pop', 0)() ``` * **Most operators call the object's special method that is named after them (second object is passed as an argument), while logical operators call their own code that relies on bool().** -* **Comparisons can be chained: `'x < y < z'` is the same as `'(x < y) and (y < z)`'.** +* **Comparisons can be chained: `'x < y < z'` gets converted to `'(x < y) and (y < z)`'.** Match Statement @@ -2352,7 +2352,7 @@ async def main_coroutine(screen): state = {'*': P(0, 0), **{id_: P(W//2, H//2) for id_ in range(10)}} ai = [random_controller(id_, moves) for id_ in range(10)] mvc = [human_controller(screen, moves), model(moves, state), view(state, screen)] - tasks = [asyncio.create_task(cor) for cor in ai + mvc] + tasks = [asyncio.create_task(coro) for coro in ai + mvc] await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED) async def random_controller(id_, moves): @@ -3354,7 +3354,7 @@ plt.show() # Displays the plot. Also plt.sav ```python = pd.read_json/html('') # Run `$ pip3 install beautifulsoup4 lxml`. - = pd.read_csv('') # `header/index_col/dtype/parse_dates=`. + = pd.read_csv('') # `header/index_col/dtype/parse_dates/…=`. = pd.read_pickle/excel('') # Use `sheet_name=None` to get all Excel sheets. = pd.read_sql('', ) # SQLite3/SQLAlchemy connection (see #SQLite). ``` diff --git a/index.html b/index.html index 4b39f68..b3297eb 100644 --- a/index.html +++ b/index.html @@ -546,7 +546,7 @@ Point(x=1, y=2
    -
  • Timezones returned by gettz(), tzlocal(), and implicit local timezone of naive objects have offsets that vary through time due to DST and historical changes of the zone's base offset.
  • +
  • Timezones returned by tzlocal(), gettz(), and implicit local timezone of naive objects have offsets that vary through time due to DST and historical changes of the zone's base offset.
  • Standard library's zoneinfo.ZoneInfo() can be used instead of gettz() on Python 3.9 and later. It requires 'tzdata' package on Windows. It doesn't return local tz if arg. is omitted.

Encode

<D/T/DT> = D/T/DT.fromisoformat(<str>)      # Object from ISO string. Raises ValueError.
@@ -1773,7 +1773,7 @@ CompletedProcess(args=['bc', pickable, queues must be sent using executor's 'initargs' and 'initializer' parameters, and all executors should only be reachable via 'if __name__ == "__main__": ...'.
+
  • ProcessPoolExecutor provides true parallelism but: everything sent to/from workers must be pickable, queues must be sent using executor's 'initargs' and 'initializer' parameters, and executor should only be reachable via 'if __name__ == "__main__": ...'.
  • #Operator

    Module of functions that provide the functionality of operators. Functions are ordered by operator precedence, starting with least binding.

    import operator as op
     <bool> = op.not_(<obj>)                                        # or, and, not (or/and missing)
    @@ -1795,7 +1795,7 @@ first_element    = op.methodcaller('pop', 
    • Most operators call the object's special method that is named after them (second object is passed as an argument), while logical operators call their own code that relies on bool().
    • -
    • Comparisons can be chained: 'x < y < z' is the same as '(x < y) and (y < z)'.
    • +
    • Comparisons can be chained: 'x < y < z' gets converted to '(x < y) and (y < z)'.

    #Match Statement

    Executes the first block with matching pattern. Added in Python 3.10.

    match <object/expression>:
         case <pattern> [if <condition>]:
    @@ -1929,7 +1929,7 @@ W, H = 15, 7
         state = {'*': P(0, 0), **{id_: P(W//2, H//2) for id_ in range(10)}}
         ai    = [random_controller(id_, moves) for id_ in range(10)]
         mvc   = [human_controller(screen, moves), model(moves, state), view(state, screen)]
    -    tasks = [asyncio.create_task(cor) for cor in ai + mvc]
    +    tasks = [asyncio.create_task(coro) for coro in ai + mvc]
         await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)
     
     async def random_controller(id_, moves):
    @@ -2740,7 +2740,7 @@ plt.show()                                     # Disp
     
    <DF> = pd.read_json/html('<str/path/url>')     # Run `$ pip3 install beautifulsoup4 lxml`.
    -<DF> = pd.read_csv('<path/url>')               # `header/index_col/dtype/parse_dates=<obj>`.
    +<DF> = pd.read_csv('<path/url>')               # `header/index_col/dtype/parse_dates/…=<obj>`.
     <DF> = pd.read_pickle/excel('<path/url>')      # Use `sheet_name=None` to get all Excel sheets.
     <DF> = pd.read_sql('<table/query>', <conn.>)   # SQLite3/SQLAlchemy connection (see #SQLite).
     
    diff --git a/parse.js b/parse.js index 355602a..b47b309 100755 --- a/parse.js +++ b/parse.js @@ -138,7 +138,7 @@ const COROUTINES = ' state = {\'*\': P(0, 0), **{id_: P(W//2, H//2) for id_ in range(10)}}\n' + ' ai = [random_controller(id_, moves) for id_ in range(10)]\n' + ' mvc = [human_controller(screen, moves), model(moves, state), view(state, screen)]\n' + - ' tasks = [asyncio.create_task(cor) for cor in ai + mvc]\n' + + ' tasks = [asyncio.create_task(coro) for coro in ai + mvc]\n' + ' await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)\n' + '\n' + 'async def random_controller(id_, moves):\n' + diff --git a/pdf/remove_links.py b/pdf/remove_links.py index 6fe342a..b7463b2 100755 --- a/pdf/remove_links.py +++ b/pdf/remove_links.py @@ -15,7 +15,7 @@ MATCHES = { 'Objects can be made sortable with \'order=True\' and immutable with \'frozen=True\'.': 'Objects can be made sortable with \'order=True\' and immutable with \'frozen=True\'.', 'For object to be hashable, all attributes must be hashable and \'frozen\' must be True.': 'For object to be hashable, all attributes must be hashable and \'frozen\' must be True.', 'Function field() is needed because \'<attr_name>: list = []\' would make a list that is shared among all instances. Its \'default_factory\' argument can be any callable.': 'Function field() is needed because \'<attr_name>: list = []\' would make a list that is shared among all instances. Its \'default_factory\' argument can be any callable (p. 17).', - 'Sequence iterators returned by the iter() function, such as list_iterator and set_iterator.': 'Sequence iterators returned by the iter() function, such as list_iterator and set_iterator (p. 3).', + 'Sequence iterators returned by the iter() function, such as list_iterator and set_iterator.': 'Sequence iterators returned by the iter() function, such as list_iterator and set_iterator.', 'Objects returned by the itertools module, such as count, repeat and cycle.': 'Objects returned by the itertools module, such as count, repeat and cycle (p. 3).', 'Generators returned by the generator functions and generator expressions.': 'Generators returned by the generator functions (p. 4) and generator expressions (p. 11).', 'File objects returned by the open() function, etc.': 'File objects returned by the open() function (p. 22), etc.', diff --git a/web/script_2.js b/web/script_2.js index e290658..17b96c3 100644 --- a/web/script_2.js +++ b/web/script_2.js @@ -18,7 +18,7 @@ const TOC_MOBILE = ' \'2. Types\': [Type, String, Regular_Exp,\n' + ' Format, Numbers,\n' + ' Combinatorics, Datetime],\n' + - ' \'3. Syntax\': [Args, Inline, Import,\n' + + ' \'3. Syntax\': [Arguments, Inline, Import,\n' + ' Decorator, Class,\n' + ' Duck_Types, Enum, Except],\n' + ' \'4. System\': [Exit, Print, Input,\n' +