Skip to content

Instantly share code, notes, and snippets.

@mxposed
Last active May 25, 2018 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxposed/6ae12f4a39677be7eb2f3731efdd4d86 to your computer and use it in GitHub Desktop.
Save mxposed/6ae12f4a39677be7eb2f3731efdd4d86 to your computer and use it in GitHub Desktop.
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