Skip to content

Instantly share code, notes, and snippets.

@hirokiky
Created June 25, 2014 14:49
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 hirokiky/aea00272fff76c30e97d to your computer and use it in GitHub Desktop.
Save hirokiky/aea00272fff76c30e97d to your computer and use it in GitHub Desktop.
_some_global_value = 'hoge'
class A(object):
def __del__(self):
global _some_global_value
_some_global_value = 'fuga'
class B(object):
def hoge(self):
return _some_global_value
assert B().hoge() == 'hoge'
a = A()
a = B()
assert a.hoge() == 'fuga'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment