Skip to content

Instantly share code, notes, and snippets.

@mwhudson
Created April 18, 2017 04:37
Show Gist options
  • Save mwhudson/66825919ed91594a61c72db6aec3c362 to your computer and use it in GitHub Desktop.
Save mwhudson/66825919ed91594a61c72db6aec3c362 to your computer and use it in GitHub Desktop.
even more pathological python
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