You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [> The mysterious key type conversion *](#-the-mysterious-key-type-conversion-)
52
52
- [> Let's see if you can guess this?](#-lets-see-if-you-can-guess-this)
53
53
-[Section: Appearances are deceptive!](#section-appearances-are-deceptive)
@@ -1091,7 +1091,7 @@ None
1091
1091
1092
1092
---
1093
1093
1094
-
### > Subclass relationships *
1094
+
### > Subclass relationships/子类关系 *
1095
1095
1096
1096
**Output:**
1097
1097
```py
@@ -1104,14 +1104,14 @@ True
1104
1104
False
1105
1105
```
1106
1106
1107
-
The Subclass relationships were expected to be transitive, right? (i.e., if `A` is a subclass of `B`, and `B` is a subclass of `C`, the `A` _should_ a subclass of `C`)
* Subclass relationships are not necessarily transitive in Python. Anyone is allowed to define their own, arbitrary `__subclasscheck__` in a metaclass.
1112
-
* When `issubclass(cls, Hashable)` is called, it simply looks for non-Falsey "`__hash__`" method in `cls` or anything it inherits from.
1113
-
* Since `object` is hashable, but `list` is non-hashable, it breaks the transitivity relation.
1114
-
* More detailed explanation can be found [here](https://www.naftaliharris.com/blog/python-subclass-intransitivity/).
0 commit comments