Last active
May 25, 2018 16:15
-
-
Save mxposed/6ae12f4a39677be7eb2f3731efdd4d86 to your computer and use it in GitHub Desktop.
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 A: | |
a_list = [] | |
def blah(self): | |
self.__class__.a_list.append('hello') | |
# can also write | |
# A.a_list.append('hello') | |
class B: | |
def bzz(self): | |
print(A.a_list) | |
a = A() | |
a.blah() | |
a.blah() | |
b = B() | |
b.bzz() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment