Browse Source

Small fixes

pull/44/head
Jure Šorn 5 years ago
parent
commit
5dd0421730
3 changed files with 19 additions and 8 deletions
  1. 6
      README.md
  2. 5
      index.html
  3. 16
      web/index_tmp.txt

6
README.md

@ -1283,8 +1283,8 @@ class MyAbcSequence(collections.abc.Sequence):
| count() | | | | yes |
+------------+----------+------------+----------+--------------+
```
* **Other ABCs that generate missing methods are: MutableSequence, Set, MutableSet, Mapping and MutableMapping. Required methods: `'<abc>.__abstractmethods__'`.**
* **Other ABCs that generate missing methods are: MutableSequence, Set, MutableSet, Mapping and MutableMapping.**
* **Names of their required methods are stored in `'<abc>.__abstractmethods__'`.**
Enum
@ -2136,7 +2136,7 @@ class MyMetaClass(type):
* **New() can also be called directly, usually from a new() method of a child class (**`def __new__(cls): return super().__new__(cls)`**), in which case init() is not called.**
### Metaclass Attribute
**Right before a class is created it checks if it has metaclass attribute defined. If not, it recursively checks if any of his parents has it defined and eventually comes to type().**
**Right before a class is created it checks if it has a 'metaclass' attribute defined. If not, it recursively checks if any of his parents has it defined and eventually comes to type().**
```python
class MyClass(metaclass=MyMetaClass):

5
index.html

@ -1209,7 +1209,8 @@ lock = threading.RLock(); <span class="hljs-keyword">with</span> lock: ...
</code></pre></div>
<ul>
<li><strong>Other ABCs that generate missing methods are: MutableSequence, Set, MutableSet, Mapping and MutableMapping. Required methods: <code class="python hljs"><span class="hljs-string">'&lt;abc&gt;.__abstractmethods__'</span></code>.</strong></li>
<li><strong>Other ABCs that generate missing methods are: MutableSequence, Set, MutableSet, Mapping and MutableMapping.</strong></li>
<li><strong>Names of their required methods are stored in <code class="python hljs"><span class="hljs-string">'&lt;abc&gt;.__abstractmethods__'</span></code>.</strong></li>
</ul>
<div><h2 id="enum"><a href="#enum" name="enum">#</a>Enum</h2><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> enum <span class="hljs-keyword">import</span> Enum, auto
@ -1860,7 +1861,7 @@ param_names = list(&lt;sig&gt;.parameters.keys())
<li><strong>It receives the same arguments as init(), except for the first one that specifies the desired class of returned instance (MyMetaClass in our case).</strong></li>
<li><strong>New() can also be called directly, usually from a new() method of a child class (</strong><code class="python hljs"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__new__</span><span class="hljs-params">(cls)</span>:</span> <span class="hljs-keyword">return</span> super().__new__(cls)</code><strong>), in which case init() is not called.</strong></li>
</ul>
<div><h3 id="metaclassattribute">Metaclass Attribute</h3><p><strong>Right before a class is created it checks if it has metaclass attribute defined. If not, it recursively checks if any of his parents has it defined and eventually comes to type().</strong></p><pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyClass</span><span class="hljs-params">(metaclass=MyMetaClass)</span>:</span>
<div><h3 id="metaclassattribute">Metaclass Attribute</h3><p><strong>Right before a class is created it checks if it has a 'metaclass' attribute defined. If not, it recursively checks if any of his parents has it defined and eventually comes to type().</strong></p><pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyClass</span><span class="hljs-params">(metaclass=MyMetaClass)</span>:</span>
b = <span class="hljs-number">12345</span>
</code></pre></div>

16
web/index_tmp.txt

@ -6,14 +6,17 @@ Index
**all function, [11](#anyall)**
**animation, [39](#animation)**
**any function, [11](#anyall)**
**argparse module, [22](#argparse)**
**arguments, [10](#arguments)**
**arrays, [28](#array)**
**audio, [39](#audio)-[40](#writefloatsamplestowavfile)**
### B
**basic script template, [41](#basicscripttemplate)**
**beautifulsoup4 library, [34](#scraping)**
**binary representation, [8](#binhex)**
**bitwise operators, [8](#bitwiseoperators)**
**bottle library, [35](#web)**
**bytes, [27](#bytes)-[28](#readbytesfromfile)**
### C
@ -47,9 +50,11 @@ Index
**exceptions, [20](#exceptions)-[21](#reraisingcaughtexception), [22](#exceptions-1)**
### F
**files, [23](#file)**
**filter function, [11](#mapfilterreduce)**
**floats, [4](#abc), [6](#floats), [7](#types)**
**format function, [6](#format)-[7](#comparisonoffloatpresentationtypes)**
**futures, [30](#threadpool)**
### G
**generator, [4](#generator)**
@ -74,6 +79,7 @@ Index
**lambda, [11](#lambda)**
**list comprehension, [11](#comprehension)**
**lists, [1](#list)-2**
**locks, [29](#lock)**
**logging, [34](#logging)**
**lru_cache decorator, [13](#lrucache)**
@ -81,8 +87,10 @@ Index
**main function, [1](#main), [41](#basicscripttemplate)**
**map function, [11](#mapfilterreduce)**
**math module, [7](#math)**
**matplotlib library, [33](#plot)**
**memoryviews, [29](#memoryview)**
**metaprograming, [31](#metaprograming)**
**mysql library, [26](#mysql)**
### N
**namedtuples, [3](#namedtuple)**
@ -117,11 +125,12 @@ Index
**requests library, [34](#scraping), [35](#test)**
### S
**SQLite module, [26](#sqlite)**
**sqlite3 module, [26](#sqlite)**
**scraping, [34](#scraping)**
**sequence, [18](#sequence), [19](#collectionsabcsequence)**
**sets, [2](#set)**
**shell commands, [24](#shellcommands)**
**sleep function, [33](#progressbar)**
**splat operator, [10](#splatoperator)-[11](#otheruses)**
**statistics module, [7](#statistics)**
**strings, [5](#string)**
@ -130,8 +139,9 @@ Index
### T
**table, [33](#table)**
**threads, [29](#threading)-[30](#threadpool)**
**time module, [35](#stopwatch)**
**threading module, [29](#threading)-[30](#threadpool)**
**time module, [33](#progressbar), [35](#stopwatch)**
**tqdm library, [33](#progressbar)**
**tuples, [3](#tuple)**
**type, [4](#type), [31](#type-1)**

Loading…
Cancel
Save