diff --git a/README.md b/README.md index 7ff3636..be0c820 100644 --- a/README.md +++ b/README.md @@ -627,8 +627,8 @@ from dateutil.tz import tzlocal, gettz ```python = D/T/DT.fromisoformat() # Object from ISO string. Raises ValueError.
= DT.strptime(, '') # Datetime from str, according to format. - = D/DT.fromordinal() # D/DTn from days since the Gregorian NYE 1. - = DT.fromtimestamp() # Local time DTn from seconds since the Epoch. + = D/DT.fromordinal() # D/DT from days since the Gregorian NYE 1. + = DT.fromtimestamp() # Local naive DT from seconds since the Epoch. = DT.fromtimestamp(, ) # Aware datetime from seconds since the Epoch. ``` * **ISO strings come in following forms: `'YYYY-MM-DD'`, `'HH:MM:SS.mmmuuu[±HH:MM]'`, or both separated by an arbitrary character. All parts following the hours are optional.** @@ -639,7 +639,7 @@ from dateutil.tz import tzlocal, gettz = .isoformat(sep='T') # Also `timespec='auto/hours/minutes/seconds/…'`. = .strftime('') # Custom string representation of the object. = .toordinal() # Days since Gregorian NYE 1, ignoring time and tz. - = .timestamp() # Seconds since the Epoch, from DTn in local tz. + = .timestamp() # Seconds since the Epoch, from local naive DT. = .timestamp() # Seconds since the Epoch, from aware datetime. ``` @@ -752,7 +752,7 @@ Inline ### Lambda ```python = lambda: # A single statement function. - = lambda , : # Also accepts default arguments. + = lambda , : # Also allows default arguments. ``` ### Comprehensions @@ -764,7 +764,7 @@ Inline ``` ```python ->>> [l+r for l in 'abc' for r in 'abc'] +>>> [l+r for l in 'abc' for r in 'abc'] # Inner loop is on the right side. ['aa', 'ab', 'ac', ..., 'cc'] ``` @@ -781,13 +781,13 @@ from functools import reduce ### Any, All ```python - = any() # Is `bool()` True for any element. - = all() # Is True for all elements or empty. + = any() # Is `bool()` True for any el? + = all() # Is True for all or is it empty? ``` ### Conditional Expression ```python - = if else # Only one expression gets evaluated. + = if else # Only one expression is evaluated. ``` ```python @@ -2236,7 +2236,7 @@ logging.basicConfig(filename=, level='DEBUG') # Configures the root logge logging.debug/info/warning/error/critical() # Logs to the root logger. = logging.getLogger(__name__) # Logger named after the module. .() # Logs to the logger. -.exception() # Calls error() with caught exception. +.exception() # Error() that appends caught exception. ``` ### Setup @@ -2816,7 +2816,7 @@ from PIL import ImageDraw .rectangle((x1, y1, x2, y2)) # To rotate use Image's rotate() and paste(). .polygon((x1, y1, x2, y2, ...)) # Last point gets connected to the first. .ellipse((x1, y1, x2, y2)) # To rotate use Image's rotate() and paste(). -.text((x, y), text, font=) # ` = ImageFont.truetype(, size)` +.text((x, y), , font=) # ` = ImageFont.truetype(, size)` ``` * **Use `'fill='` to set the primary color.** * **Use `'width='` to set the width of lines or contours.** diff --git a/index.html b/index.html index 918cac5..cfc5b08 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -550,8 +550,8 @@ Point(x=1, y=2

Encode

<D/T/DT> = D/T/DT.fromisoformat(<str>)      # Object from ISO string. Raises ValueError.
 <DT>     = DT.strptime(<str>, '<format>')   # Datetime from str, according to format.
-<D/DTn>  = D/DT.fromordinal(<int>)          # D/DTn from days since the Gregorian NYE 1.
-<DTn>    = DT.fromtimestamp(<float>)        # Local time DTn from seconds since the Epoch.
+<D/DTn>  = D/DT.fromordinal(<int>)          # D/DT from days since the Gregorian NYE 1.
+<DTn>    = DT.fromtimestamp(<float>)        # Local naive DT from seconds since the Epoch.
 <DTa>    = DT.fromtimestamp(<float>, <tz>)  # Aware datetime from seconds since the Epoch.
 
@@ -562,7 +562,7 @@ Point(x=1, y=2

Decode

<str>    = <D/T/DT>.isoformat(sep='T')      # Also `timespec='auto/hours/minutes/seconds/…'`.
 <str>    = <D/T/DT>.strftime('<format>')    # Custom string representation of the object.
 <int>    = <D/DT>.toordinal()               # Days since Gregorian NYE 1, ignoring time and tz.
-<float>  = <DTn>.timestamp()                # Seconds since the Epoch, from DTn in local tz.
+<float>  = <DTn>.timestamp()                # Seconds since the Epoch, from local naive DT.
 <float>  = <DTa>.timestamp()                # Seconds since the Epoch, from aware datetime.
 
@@ -642,7 +642,7 @@ func(*args, **kwargs)
head, *body, tail = <coll.>     # 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 accepts default arguments.
+<func> = lambda <arg_1>, <arg_2>: <return_value>    # Also allows default arguments.
 
@@ -652,7 +652,7 @@ func(*args, **kwargs) <dict> = {i: i*2 for i in range(10)} # Or: {0: 0, 1: 2, ..., 9: 18} -
>>> [l+r for l in 'abc' for r in 'abc']
+
>>> [l+r for l in 'abc' for r in 'abc']             # Inner loop is on the right side.
 ['aa', 'ab', 'ac', ..., 'cc']
 

Map, Filter, Reduce

from functools import reduce
@@ -662,11 +662,11 @@ func(*args, **kwargs)
 <iter> = filter(lambda x: x > 5, range(10))         # Or: iter([6, 7, 8, 9])
 <obj>  = reduce(lambda out, x: out + x, range(10))  # Or: 45
 
-

Any, All

<bool> = any(<collection>)                          # Is `bool(<el>)` True for any element.
-<bool> = all(<collection>)                          # Is True for all elements or empty.
+

Any, All

<bool> = any(<collection>)                          # Is `bool(<el>)` True for any el?
+<bool> = all(<collection>)                          # Is True for all or is it empty?
 
-

Conditional Expression

<obj> = <exp> if <condition> else <exp>             # Only one expression gets evaluated.
+

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`
@@ -1844,7 +1844,7 @@ first_element    = op.methodcaller('pop', # Logs to the root logger.
 <Logger> = logging.getLogger(__name__)               # Logger named after the module.
 <Logger>.<level>(<str>)                              # Logs to the logger.
-<Logger>.exception(<str>)                            # Calls error() with caught exception.
+<Logger>.exception(<str>)                            # Error() that appends caught exception.
 

Setup

logging.basicConfig(
     filename=None,                                   # Logs to console (stderr) by default.
@@ -2311,7 +2311,7 @@ img.show()
 <ImageDraw>.rectangle((x1, y1, x2, y2))         # To rotate use Image's rotate() and paste().
 <ImageDraw>.polygon((x1, y1, x2, y2, ...))      # Last point gets connected to the first.
 <ImageDraw>.ellipse((x1, y1, x2, y2))           # To rotate use Image's rotate() and paste().
-<ImageDraw>.text((x, y), text, font=<Font>)     # `<Font> = ImageFont.truetype(<path>, size)`
+<ImageDraw>.text((x, y), <str>, font=<Font>)    # `<Font> = ImageFont.truetype(<path>, size)`
 
    @@ -2932,7 +2932,7 @@ $ deactivate # Deactivates the activ