Skip to content

Instantly share code, notes, and snippets.

View pop's full-sized avatar

Elijah Voigt pop

View GitHub Profile
@pop
pop / .gitignore
Last active September 19, 2015 23:31
a liveblog
.gitignore
.venv/
venv/
index.html
@iankronquist
iankronquist / classes.py
Last active August 29, 2015 14:20
A quick introdution to Python classes
# This is the new style way of declaring classes and should be preferred
# Python screwed up the way classes and typing works the first go round,
# but they fixed it with new style classes
class Object(object):
# This is the constructor. It takes an instance of the object and a single argument called foo.
def __init__(self, foo):
# Make foo a property of this instance
self.foo = foo
# Add n to foo. Note that if foo is a string, n must also be a string,
# or if foo is a numeric type, foo must also be numeric