Created
April 18, 2017 04:37
-
-
Save mwhudson/66825919ed91594a61c72db6aec3c362 to your computer and use it in GitHub Desktop.
even more 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
class T(type): | |
def mro(cls): | |
global C | |
C = cls | |
return [] | |
try: | |
T("T", (), {}) | |
except TypeError: | |
pass | |
class Y(object): | |
pass | |
x = Y() | |
x.__class__ = C | |
print(isinstance(x, object)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment