Created
August 24, 2022 18:07
-
-
Save fruch/79caa8ec2d8c54e4686cb27639644948 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Foo: | |
x = None | |
def __init__(self): | |
self.x = set() | |
setattr(self, 'x', set()) | |
@classmethod | |
def x(cls): | |
print(Foo.x) | |
return True | |
def what(self): | |
print(Foo.x) | |
print(Foo.x) | |
a = Foo() | |
print(a.x) | |
print(Foo.x) | |
a.what() | |
''' | |
<bound method Foo.x of <class '__main__.Foo'>> | |
set() | |
<bound method Foo.x of <class '__main__.Foo'>> | |
<bound method Foo.x of <class '__main__.Foo'>> | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment