@@ -270,13 +270,13 @@ True
270
270
```
271
271
272
272
``` text
273
- +------------------+----------+------------+----------+
274
- | | Sequence | Collection | Iterable |
275
- +------------------+----------+------------+----------+
276
- | list, range, str | yes | yes | yes |
277
- | dict, set | | yes | yes |
278
- | iter | | | yes |
279
- +------------------+----------+------------+----------+
273
+ +------------------+------------ +------------+-- ----------+
274
+ | | Sequence | Collection | Iterable |
275
+ +------------------+------------ +------------+-- ----------+
276
+ | list, range, str | yes | yes | yes |
277
+ | dict, set | | yes | yes |
278
+ | iter | | | yes |
279
+ +------------------+------------ +------------+-- ----------+
280
280
```
281
281
282
282
``` python
@@ -286,15 +286,15 @@ True
286
286
```
287
287
288
288
``` text
289
- +--------------------+----------+----------+--------+---------+ --------+
290
- | | Integral | Rational | Real | Complex | Number |
291
- +--------------------+----------+----------+--------+---------+ --------+
292
- | int | yes | yes | yes | yes | yes |
293
- | fractions.Fraction | | yes | yes | yes | yes |
294
- | float | | | yes | yes | yes |
295
- | complex | | | | yes | yes |
296
- | decimal.Decimal | | | | | yes |
297
- +--------------------+----------+----------+--------+---------+ --------+
289
+ +--------------------+----------+----------+---------- +----------+-- --------+
290
+ | | Integral | Rational | Real | Complex | Number |
291
+ +--------------------+----------+----------+---------- +----------+-- --------+
292
+ | int | yes | yes | yes | yes | yes |
293
+ | fractions.Fraction | | yes | yes | yes | yes |
294
+ | float | | | yes | yes | yes |
295
+ | complex | | | | yes | yes |
296
+ | decimal.Decimal | | | | | yes |
297
+ +--------------------+----------+----------+---------- +----------+-- --------+
298
298
```
299
299
300
300
@@ -443,32 +443,32 @@ Format
443
443
444
444
#### Comparison of float presentation types:
445
445
``` text
446
- +---------------- +----------------+---------------+ ----------------+-----------------+
447
- | | {<float>} | {<float>:f} | {<float>:e} | {<float>:%} |
448
- +---------------- +----------------+---------------+ ----------------+-----------------+
449
- | 0.000056789 | '5.6789e-05' | '0.000057' | '5.678900e-05' | '0.005679%' |
450
- | 0.00056789 | '0.00056789' | '0.000568' | '5.678900e-04' | '0.056789%' |
451
- | 0.0056789 | '0.0056789' | '0.005679' | '5.678900e-03' | '0.567890%' |
452
- | 0.056789 | '0.056789' | '0.056789' | '5.678900e-02' | '5.678900%' |
453
- | 0.56789 | '0.56789' | '0.567890' | '5.678900e-01' | '56.789000%' |
454
- | 5.6789 | '5.6789' | '5.678900' | '5.678900e+00' | '567.890000%' |
455
- | 56.789 | '56.789' | '56.789000' | '5.678900e+01' | '5678.900000%' |
456
- | 567.89 | '567.89' | '567.890000' | '5.678900e+02' | '56789.000000%' |
457
- +---------------- +----------------+---------------+ ----------------+-----------------+
446
+ +---------------+----------------- +-----------------+- ----------------+-----------------+
447
+ | | {<float>} | {<float>:f} | {<float>:e} | {<float>:%} |
448
+ +---------------+----------------- +-----------------+- ----------------+-----------------+
449
+ | 0.000056789 | '5.6789e-05' | '0.000057' | '5.678900e-05' | '0.005679%' |
450
+ | 0.00056789 | '0.00056789' | '0.000568' | '5.678900e-04' | '0.056789%' |
451
+ | 0.0056789 | '0.0056789' | '0.005679' | '5.678900e-03' | '0.567890%' |
452
+ | 0.056789 | '0.056789' | '0.056789' | '5.678900e-02' | '5.678900%' |
453
+ | 0.56789 | '0.56789' | '0.567890' | '5.678900e-01' | '56.789000%' |
454
+ | 5.6789 | '5.6789' | '5.678900' | '5.678900e+00' | '567.890000%' |
455
+ | 56.789 | '56.789' | '56.789000' | '5.678900e+01' | '5678.900000%' |
456
+ | 567.89 | '567.89' | '567.890000' | '5.678900e+02' | '56789.000000%' |
457
+ +---------------+----------------- +-----------------+- ----------------+-----------------+
458
458
```
459
459
``` text
460
- +---------------- +----------------+---------------+ ----------------+-----------------+
461
- | | {<float>:.2} | {<float>:.2f} | {<float>:.2e} | {<float>:.2%} |
462
- +---------------- +----------------+---------------+ ----------------+-----------------+
463
- | 0.000056789 | '5.7e-05' | '0.00' | '5.68e-05' | '0.01%' |
464
- | 0.00056789 | '0.00057' | '0.00' | '5.68e-04' | '0.06%' |
465
- | 0.0056789 | '0.0057' | '0.01' | '5.68e-03' | '0.57%' |
466
- | 0.056789 | '0.057' | '0.06' | '5.68e-02' | '5.68%' |
467
- | 0.56789 | '0.57' | '0.57' | '5.68e-01' | '56.79%' |
468
- | 5.6789 | '5.7' | '5.68' | '5.68e+00' | '567.89%' |
469
- | 56.789 | '5.7e+01' | '56.79' | '5.68e+01' | '5678.90%' |
470
- | 567.89 | '5.7e+02' | '567.89' | '5.68e+02' | '56789.00%' |
471
- +---------------- +----------------+---------------+ ----------------+-----------------+
460
+ +---------------+----------------- +-----------------+- ----------------+-----------------+
461
+ | | {<float>:.2} | {<float>:.2f} | {<float>:.2e} | {<float>:.2%} |
462
+ +---------------+----------------- +-----------------+- ----------------+-----------------+
463
+ | 0.000056789 | '5.7e-05' | '0.00' | '5.68e-05' | '0.01%' |
464
+ | 0.00056789 | '0.00057' | '0.00' | '5.68e-04' | '0.06%' |
465
+ | 0.0056789 | '0.0057' | '0.01' | '5.68e-03' | '0.57%' |
466
+ | 0.056789 | '0.057' | '0.06' | '5.68e-02' | '5.68%' |
467
+ | 0.56789 | '0.57' | '0.57' | '5.68e-01' | '56.79%' |
468
+ | 5.6789 | '5.7' | '5.68' | '5.68e+00' | '567.89%' |
469
+ | 56.789 | '5.7e+01' | '56.79' | '5.68e+01' | '5678.90%' |
470
+ | 567.89 | '5.7e+02' | '567.89' | '5.68e+02' | '56789.00%' |
471
+ +---------------+----------------- +-----------------+- ----------------+-----------------+
472
472
```
473
473
474
474
### Ints
@@ -1274,17 +1274,17 @@ class MyAbcSequence(collections.abc.Sequence):
1274
1274
1275
1275
#### Table of required and available special methods:
1276
1276
``` text
1277
- +------------+----------+------------+----------+--------------+
1278
- | | Iterable | Collection | Sequence | abc.Sequence |
1279
- +------------+----------+------------+----------+--------------+
1280
- | iter() | REQ | REQ | yes | yes |
1281
- | contains() | yes | yes | yes | yes |
1282
- | len() | | REQ | REQ | REQ |
1283
- | getitem() | | | REQ | REQ |
1284
- | reversed() | | | yes | yes |
1285
- | index() | | | | yes |
1286
- | count() | | | | yes |
1287
- +------------+----------+------------+----------+--------------+
1277
+ +------------+------------ +------------+-- ----------+--------------+
1278
+ | | Iterable | Collection | Sequence | abc.Sequence |
1279
+ +------------+------------ +------------+-- ----------+--------------+
1280
+ | iter() | REQ | REQ | yes | yes |
1281
+ | contains() | yes | yes | yes | yes |
1282
+ | len() | | REQ | REQ | REQ |
1283
+ | getitem() | | | REQ | REQ |
1284
+ | reversed() | | | yes | yes |
1285
+ | index() | | | | yes |
1286
+ | count() | | | | yes |
1287
+ +------------+------------ +------------+-- ----------+--------------+
1288
1288
```
1289
1289
* ** Other ABCs that generate missing methods are: MutableSequence, Set, MutableSet, Mapping and MutableMapping.**
1290
1290
* ** Names of their required methods are stored in ` '<abc>.__abstractmethods__' ` .**
@@ -1421,14 +1421,14 @@ BaseException
1421
1421
1422
1422
#### Collections and their exceptions:
1423
1423
``` text
1424
- +-----------+------------+----------+ ----------+
1425
- | | list | dict | set |
1426
- +-----------+------------+----------+ ----------+
1427
- | getitem() | IndexError | KeyError | |
1428
- | pop() | IndexError | KeyError | KeyError |
1429
- | remove() | ValueError | | KeyError |
1430
- | index() | ValueError | | |
1431
- +-----------+------------+----------+ ----------+
1424
+ +-----------+------------+------------+-- ----------+
1425
+ | | list | dict | set |
1426
+ +-----------+------------+------------+-- ----------+
1427
+ | getitem() | IndexError | KeyError | |
1428
+ | pop() | IndexError | KeyError | KeyError |
1429
+ | remove() | ValueError | | KeyError |
1430
+ | index() | ValueError | | |
1431
+ +-----------+------------+------------+-- ----------+
1432
1432
```
1433
1433
1434
1434
### User-defined Exceptions
@@ -1770,17 +1770,17 @@ import csv
1770
1770
1771
1771
### Dialects
1772
1772
``` text
1773
- +------------------+-----------+ -----------+--------------+
1774
- | | excel | excel_tab | unix_dialect |
1775
- +------------------+-----------+ -----------+--------------+
1776
- | delimiter | ',' | '\t' | ',' |
1777
- | quotechar | '"' | '"' | '"' |
1778
- | doublequote | True | True | True |
1779
- | skipinitialspace | False | False | False |
1780
- | lineterminator | '\r\n' | '\r\n' | '\n' |
1781
- | quoting | 0 | 0 | 1 |
1782
- | escapechar | None | None | None |
1783
- +------------------+-----------+ -----------+--------------+
1773
+ +------------------+--------------+--- -----------+--------------+
1774
+ | | excel | excel_tab | unix_dialect |
1775
+ +------------------+--------------+--- -----------+--------------+
1776
+ | delimiter | ',' | '\t' | ',' |
1777
+ | quotechar | '"' | '"' | '"' |
1778
+ | doublequote | True | True | True |
1779
+ | skipinitialspace | False | False | False |
1780
+ | lineterminator | '\r\n' | '\r\n' | '\n' |
1781
+ | quoting | 0 | 0 | 1 |
1782
+ | escapechar | None | None | None |
1783
+ +------------------+--------------+--- -----------+--------------+
1784
1784
```
1785
1785
1786
1786
### Read Rows from CSV File
@@ -2169,15 +2169,15 @@ type(MyMetaClass) == type # MyMetaClass is an instance of type.
2169
2169
```
2170
2170
2171
2171
``` text
2172
- +---------+-------------+
2173
- | Classes | Metaclasses |
2174
- +---------+-------------|
2175
- | MyClass > MyMetaClass |
2176
- | | v |
2177
- | object ---> type <+ |
2178
- | | ^ +---+ |
2179
- | str -------+ |
2180
- +---------+-------------+
2172
+ +------------- +-------------+
2173
+ | Classes | Metaclasses |
2174
+ +------------- +-------------|
2175
+ | MyClass -- > MyMetaClass |
2176
+ | | v |
2177
+ | object -- ---> type <+ |
2178
+ | | ^ +---+ |
2179
+ | str -- -------+ |
2180
+ +------------- +-------------+
2181
2181
```
2182
2182
2183
2183
### Inheritance Diagram
@@ -2187,15 +2187,15 @@ MyMetaClass.__base__ == type # MyMetaClass is a subclass of type.
2187
2187
```
2188
2188
2189
2189
``` text
2190
- +---------+-------------+
2191
- | Classes | Metaclasses |
2192
- +---------+-------------|
2193
- | MyClass | MyMetaClass |
2194
- | v | v |
2195
- | object <--- type |
2196
- | ^ | |
2197
- | str | |
2198
- +---------+-------------+
2190
+ +------------- +-------------+
2191
+ | Classes | Metaclasses |
2192
+ +------------- +-------------|
2193
+ | MyClass | MyMetaClass |
2194
+ | v | v |
2195
+ | object <-- --- type |
2196
+ | ^ | |
2197
+ | str | |
2198
+ +------------- +-------------+
2199
2199
```
2200
2200
2201
2201
0 commit comments