From 7994beb0e2961843ee1d30152cb07ada5aca5217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 13 Jul 2022 14:31:51 +0200 Subject: [PATCH] Tuple, Range, Iterator --- README.md | 20 ++++++++++---------- index.html | 23 +++++++++++------------ parse.js | 7 ------- 3 files changed, 21 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index f7b53b1..cf3c0f5 100644 --- a/README.md +++ b/README.md @@ -144,9 +144,9 @@ Tuple ----- **Tuple is an immutable and hashable list.** ```python - = () # Or: tuple() - = (,) # Or: , - = (, [, ...]) # Or: , [, ...] + = () # Empty tuple. + = (,) # Or: , + = (, [, ...]) # Or: , [, ...] ``` ### Named Tuple @@ -163,17 +163,17 @@ Point(x=1, y=2) 1 >>> getattr(p, 'y') 2 ->>> p._fields # Or: Point._fields -('x', 'y') ``` Range ----- +**An immutable and hashable sequence of evenly spaced integers.** + ```python - = range(to_exclusive) - = range(from_inclusive, to_exclusive) - = range(from_inclusive, to_exclusive, ±step_size) + = range(to_exclusive) # `list(range(3)) == [0, 1, 2]` + = range(from_inclusive, to_exclusive) # `list(range(1, 4)) == [1, 2, 3]` + = range(from_inclusive, to_exclusive, ±step) # `list(range(3, 0, -1)) == [3, 2, 1]` ``` ```python @@ -212,12 +212,12 @@ from itertools import count, repeat, cycle, chain, islice ```python = chain(, [, ...]) # Empties collections in order (figuratively). - = chain.from_iterable() # Empties collections inside a collection in order. + = chain.from_iterable() # Empties collections inside a collection in order. ``` ```python = islice(, to_exclusive) # Only returns first 'to_exclusive' elements. - = islice(, from_inclusive, …) # `to_exclusive, step_size`. + = islice(, from_inclusive, …) # `to_exclusive, +step`. ``` diff --git a/index.html b/index.html index 960485f..87fe19e 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -182,9 +182,9 @@ Counter({'blue': 3 -

#Tuple

Tuple is an immutable and hashable list.

<tuple> = ()                                # Or: tuple()
-<tuple> = (<el>,)                           # Or: <el>,
-<tuple> = (<el_1>, <el_2> [, ...])          # Or: <el_1>, <el_2> [, ...]
+

#Tuple

Tuple is an immutable and hashable list.

<tuple> = ()                        # Empty tuple.
+<tuple> = (<el>,)                   # Or: <el>,
+<tuple> = (<el_1>, <el_2> [, ...])  # Or: <el_1>, <el_2> [, ...]
 
@@ -198,16 +198,15 @@ Point(x=1, y=2 1 >>> getattr(p, 'y') 2 ->>> p._fields # Or: Point._fields -('x', 'y')
-

#Range

<range> = range(to_exclusive)
-<range> = range(from_inclusive, to_exclusive)
-<range> = range(from_inclusive, to_exclusive, ±step_size)
+

#Range

An immutable and hashable sequence of evenly spaced integers.

<range> = range(to_exclusive)                         # `list(range(3))        == [0, 1, 2]`
+<range> = range(from_inclusive, to_exclusive)         # `list(range(1, 4))     == [1, 2, 3]`
+<range> = range(from_inclusive, to_exclusive, ±step)  # `list(range(3, 0, -1)) == [3, 2, 1]`
 
+
from_inclusive = <range>.start
 to_exclusive   = <range>.stop
 
@@ -229,10 +228,10 @@ to_exclusive = <range>.stop <iter> = cycle(<collection>) # Repeats the sequence endlessly.
<iter> = chain(<coll_1>, <coll_2> [, ...])  # Empties collections in order (figuratively).
-<iter> = chain.from_iterable(<collection>)  # Empties collections inside a collection in order.
+<iter> = chain.from_iterable(<coll>)        # Empties collections inside a collection in order.
 
<iter> = islice(<coll>, to_exclusive)       # Only returns first 'to_exclusive' elements.
-<iter> = islice(<coll>, from_inclusive, …)  # `to_exclusive, step_size`.
+<iter> = islice(<coll>, from_inclusive, …)  # `to_exclusive, +step`.
 

#Generator

  • Any function that contains a yield statement returns a generator.
  • @@ -2901,7 +2900,7 @@ $ pyinstaller script.py --add-data '<path>:.' diff --git a/parse.js b/parse.js index 0eb1090..af5307c 100755 --- a/parse.js +++ b/parse.js @@ -794,13 +794,6 @@ function fixStructFormatDiv() { $('#forstandardtypesizesandmanualalignmentpaddingstartformatstringwith').parent().insertBefore(div) } - -function fixStructFormat() { - const div = $('#format-2').parent() - $('#format-2').insertBefore(div) - $('#forstandardtypesizesandmanualalignmentpaddingstartformatstringwith').parent().insertBefore(div) -} - function updateDate(template) { const date = new Date(); const date_str = date.toLocaleString('en-us', {month: 'long', day: 'numeric', year: 'numeric'});