From cbdad5e3a8d748e86a256d05ee4d7feff7206b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Mon, 1 Jul 2019 20:10:01 +0200 Subject: [PATCH] Metaprograming --- README.md | 5 ++--- index.html | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d767a14..85f4e13 100644 --- a/README.md +++ b/README.md @@ -1725,7 +1725,6 @@ class MyClass(metaclass=MyMetaClass): ```python type(MyClass) == MyMetaClass # MyClass is an instance of MyMetaClass. type(MyMetaClass) == type # MyMetaClass is an instance of type. -type(type) == type # Type is an instance of type. ``` ```text @@ -1742,8 +1741,8 @@ type(type) == type # Type is an instance of type. ### Inheritance Diagram ```python -MyClass.__base__ == object # MyClass is a subclass of object. -object.__base__ == None # Object is a subclass to no one. +MyClass.__base__ == object # MyClass is a subclass of object. +MyMetaClass.__base__ == type # MyMetaClass is a subclass of type. ``` ```text diff --git a/index.html b/index.html index cad7495..d803dac 100644 --- a/index.html +++ b/index.html @@ -1469,7 +1469,6 @@ param_names = list(<sig>.parameters.keys())

Type Diagram

type(MyClass)     == MyMetaClass  # MyClass is an instance of MyMetaClass.
 type(MyMetaClass) == type         # MyMetaClass is an instance of type.
-type(type)        == type         # Type is an instance of type.
 
┏━━━━━━━━━┯━━━━━━━━━━━━━┓
 ┃ Classes │ Metaclasses ┃
@@ -1482,8 +1481,8 @@ type(type)        == type         # Type is an instan
 ┗━━━━━━━━━┷━━━━━━━━━━━━━┛
 

Inheritance Diagram

-
MyClass.__base__  == object       # MyClass is a subclass of object.
-object.__base__   == None         # Object is a subclass to no one.
+
MyClass.__base__     == object    # MyClass is a subclass of object.
+MyMetaClass.__base__ == type      # MyMetaClass is a subclass of type.
 
┏━━━━━━━━━┯━━━━━━━━━━━━━┓
 ┃ Classes │ Metaclasses ┃