Skip to content

Instantly share code, notes, and snippets.

@mtomwing
Created February 8, 2014 01:46
Show Gist options
  • Save mtomwing/8875432 to your computer and use it in GitHub Desktop.
Save mtomwing/8875432 to your computer and use it in GitHub Desktop.
class MyClass(object):
FOO = 'bar'
def some_method(self):
pass
print dir(MyClass)
print hasattr(MyClass, 'FOO')
print hasattr(MyClass, 'HELLO')
print getattr(MyClass, 'FOO')
print MyClass.FOO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment