diff --git a/README.md b/README.md index 544b247..05a0e60 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ if __name__ == '__main__': # Runs main() if file wasn't imported. List ---- ```python - = [from_inclusive : to_exclusive : ±step_size] + = [] # Or: [from_inclusive : to_exclusive : ±step] ``` ```python @@ -38,10 +38,10 @@ List ``` ```python -.sort() -.reverse() - = sorted() - = reversed() +.sort() # Sorts in ascending order. +.reverse() # Reverses the list in-place. + = sorted() # Returns a new sorted list. + = reversed() # Returns reversed iterator. ``` ```python @@ -643,7 +643,6 @@ from dateutil.tz import UTC, tzlocal, gettz, datetime_exists, resolve_imaginary ### Format ```python ->>> from datetime import datetime >>> dt = datetime.strptime('2015-05-14 23:39:00.00 +0200', '%Y-%m-%d %H:%M:%S.%f %z') >>> dt.strftime("%A, %dth of %B '%y, %I:%M%p %Z") "Thursday, 14th of May '15, 11:39PM UTC+02:00" @@ -653,10 +652,11 @@ from dateutil.tz import UTC, tzlocal, gettz, datetime_exists, resolve_imaginary ### Arithmetics ```python - = ± # Returned datetime can fall into missing hour. - = - # Returns the difference, ignoring time jumps. - = - # Ignores time jumps if they share tzinfo object. - = - # Convert DTs to UTC to get the actual delta. + = ± # Returned datetime can fall into missing hour. + = - # Returns the difference, ignoring time jumps. + = - # Ignores time jumps if they share tzinfo object. + = * # Also: = abs() and = ±% + = / # How many weeks/years there are in TD. Also '//'. ``` diff --git a/index.html b/index.html index 759ac0b..4c415c7 100644 --- a/index.html +++ b/index.html @@ -226,7 +226,7 @@ pre.prettyprint {
- +
@@ -253,16 +253,16 @@ pre.prettyprint { main() -

#List

<list> = <list>[from_inclusive : to_exclusive : ±step_size]
+

#List

<list> = <list>[<slice>]       # Or: <list>[from_inclusive : to_exclusive : ±step]
 
<list>.append(<el>)            # Or: <list> += [<el>]
 <list>.extend(<collection>)    # Or: <list> += <collection>
 
-
<list>.sort()
-<list>.reverse()
-<list> = sorted(<collection>)
-<iter> = reversed(<list>)
+
<list>.sort()                  # Sorts in ascending order.
+<list>.reverse()               # Reverses the list in-place.
+<list> = sorted(<collection>)  # Returns a new sorted list.
+<iter> = reversed(<list>)      # Returns reversed iterator.
 
sum_of_elements  = sum(<collection>)
 elementwise_sum  = [sum(pair) for pair in zip(list_a, list_b)]
@@ -723,8 +723,7 @@ to_exclusive   = <range>.stop
 <float>  = <DTa>.timestamp()                # Seconds since the Epoch, from DTa.
 
-

Format

>>> from datetime import datetime
->>> dt = datetime.strptime('2015-05-14 23:39:00.00 +0200', '%Y-%m-%d %H:%M:%S.%f %z')
+

Format

>>> dt = datetime.strptime('2015-05-14 23:39:00.00 +0200', '%Y-%m-%d %H:%M:%S.%f %z')
 >>> dt.strftime("%A, %dth of %B '%y, %I:%M%p %Z")
 "Thursday, 14th of May '15, 11:39PM UTC+02:00"
 
@@ -733,10 +732,11 @@ to_exclusive = <range>.stop
  • '%Z' only accepts 'UTC/GMT' and local timezone's code. '%z' also accepts '±HH:MM'.
  • For abbreviated weekday and month use '%a' and '%b'.
  • -

    Arithmetics

    <D/DT>   = <D/DT>   ± <TD>                  # Returned datetime can fall into missing hour.
    -<TD>     = <D/DTn>  - <D/DTn>               # Returns the difference, ignoring time jumps.
    -<TD>     = <DTa>    - <DTa>                 # Ignores time jumps if they share tzinfo object.
    -<TD>     = <DT_UTC> - <DT_UTC>              # Convert DTs to UTC to get the actual delta.
    +

    Arithmetics

    <D/DT>   = <D/DT>  ± <TD>                   # Returned datetime can fall into missing hour.
    +<TD>     = <D/DTn> - <D/DTn>                # Returns the difference, ignoring time jumps.
    +<TD>     = <DTa>   - <DTa>                  # Ignores time jumps if they share tzinfo object.
    +<TD>     = <TD>    * <real>                 # Also: <TD> = abs(<TD>) and <TD> = <TD> ±% <TD>
    +<float>  = <TD>    / <TD>                   # How many weeks/years there are in TD. Also '//'.
     

    #Arguments

    Inside Function Call

    <function>(<positional_args>)                  # f(0, 0)
    @@ -3020,7 +3020,7 @@ $ pyinstaller script.py --add-data '<path>:.'