Created
March 4, 2023 18:28
-
-
Save shrimo/32ca5e3aa3a1efe27211666c7f54dae6 to your computer and use it in GitHub Desktop.
strange object behavior
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 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