Skip to content

Commit cbdad5e

Browse files
committed
Metaprograming
1 parent 80fc183 commit cbdad5e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,6 @@ class MyClass(metaclass=MyMetaClass):
17251725
```python
17261726
type(MyClass) == MyMetaClass # MyClass is an instance of MyMetaClass.
17271727
type(MyMetaClass) == type # MyMetaClass is an instance of type.
1728-
type(type) == type # Type is an instance of type.
17291728
```
17301729

17311730
```text
@@ -1742,8 +1741,8 @@ type(type) == type # Type is an instance of type.
17421741

17431742
### Inheritance Diagram
17441743
```python
1745-
MyClass.__base__ == object # MyClass is a subclass of object.
1746-
object.__base__ == None # Object is a subclass to no one.
1744+
MyClass.__base__ == object # MyClass is a subclass of object.
1745+
MyMetaClass.__base__ == type # MyMetaClass is a subclass of type.
17471746
```
17481747

17491748
```text

index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,6 @@ <h3 id="metaclassattribute">Metaclass Attribute</h3>
14691469
<h3 id="typediagram">Type Diagram</h3>
14701470
<pre><code class="python language-python hljs">type(MyClass) == MyMetaClass <span class="hljs-comment"># MyClass is an instance of MyMetaClass.</span>
14711471
type(MyMetaClass) == type <span class="hljs-comment"># MyMetaClass is an instance of type.</span>
1472-
type(type) == type <span class="hljs-comment"># Type is an instance of type.</span>
14731472
</code></pre>
14741473
<pre><code class="text language-text">┏━━━━━━━━━┯━━━━━━━━━━━━━┓
14751474
┃ Classes │ Metaclasses ┃
@@ -1482,8 +1481,8 @@ <h3 id="typediagram">Type Diagram</h3>
14821481
┗━━━━━━━━━┷━━━━━━━━━━━━━┛
14831482
</code></pre>
14841483
<h3 id="inheritancediagram">Inheritance Diagram</h3>
1485-
<pre><code class="python language-python hljs">MyClass.__base__ == object <span class="hljs-comment"># MyClass is a subclass of object.</span>
1486-
object.__base__ == <span class="hljs-keyword">None</span> <span class="hljs-comment"># Object is a subclass to no one.</span>
1484+
<pre><code class="python language-python hljs">MyClass.__base__ == object <span class="hljs-comment"># MyClass is a subclass of object.</span>
1485+
MyMetaClass.__base__ == type <span class="hljs-comment"># MyMetaClass is a subclass of type.</span>
14871486
</code></pre>
14881487
<pre><code class="text language-text">┏━━━━━━━━━┯━━━━━━━━━━━━━┓
14891488
┃ Classes │ Metaclasses ┃

0 commit comments

Comments
 (0)