Skip to content

Instantly share code, notes, and snippets.

@aaronfay
Created November 27, 2011 03:53
Show Gist options
  • Save aaronfay/1396928 to your computer and use it in GitHub Desktop.
Save aaronfay/1396928 to your computer and use it in GitHub Desktop.
Object construction in Python
# Python
class Widget(object):
"""This is a widget class."""
def __init__(self):
"This is the constructor method."
print "constructed"
widget = Widget()
# console: constructed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment