Created
March 5, 2012 13:26
-
-
Save raimon49/1978293 to your computer and use it in GitHub Desktop.
明示的に親クラスの__init__()を呼び出し
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# super 使わない | |
class Base(object): | |
def __init__(self): | |
print('Base') | |
class Sub(Base): | |
def __init__(self): | |
Base.__init__(self) | |
print('Sub') | |
if __name__ == '__main__': | |
Sub() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment