This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gitignore | |
.venv/ | |
venv/ | |
index.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |