Created
April 15, 2017 19:31
-
-
Save mwhudson/71f47be52ea722506f0a42d3dba53746 to your computer and use it in GitHub Desktop.
pathological python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mwhudson@aeglos:~$ cat mro.py | |
class T(type): | |
def mro(self): | |
return [] | |
class X(object,metaclass=T): | |
pass | |
class Y(object): | |
pass | |
x = Y() | |
x.__class__ = X | |
print(isinstance(x, object)) | |
mwhudson@aeglos:~$ python3 mro.py | |
False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On Python 3.6.x: