Skip to content

Instantly share code, notes, and snippets.

@shrimo
Created March 4, 2023 18:28
Show Gist options
  • Save shrimo/32ca5e3aa3a1efe27211666c7f54dae6 to your computer and use it in GitHub Desktop.
Save shrimo/32ca5e3aa3a1efe27211666c7f54dae6 to your computer and use it in GitHub Desktop.
strange object behavior
class CX:...
CX.m = lambda x : x
a = CX
CX.n = lambda y : y
b = CX
print(a is b)
print(id(a.n(a)) is id(b.m(b)))
print(id(a.n(a)) == id(b.m(b)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment