Last active
August 29, 2015 14:10
-
-
Save scott-wilson/8864b3181d2f1988105c to your computer and use it in GitHub Desktop.
C++ Question
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 Foo(object): | |
def __init__(self, value): | |
self._value = value | |
class Bar(Foo): | |
def __init__(self, value): | |
value = do_something_to_value(value) | |
# Calls the parent class's version of __init__. | |
super(Bar, value).__init__(value) | |
def do_something_to_value(value): | |
return value * 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment