Created
March 25, 2012 14:16
-
-
Save miloir/2195378 to your computer and use it in GitHub Desktop.
Python Inheritance: Easy Mode Short Tutorial 1 code
This file contains 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
class MyDict(dict): | |
def __init__(self, *args, **kwargs): | |
dict.__init__(self, *args, **kwargs) | |
def get(self, key, default=None): | |
print "getting key: %s" % key | |
return super(MyDict, self).get(key, default=default) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment