Last active
August 29, 2015 14:03
-
-
Save kwatch/525cee75ef89bd5dbf0b to your computer and use it in GitHub Desktop.
[python] Is it impossible to override __init__() method of classes implemented in C?
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
from datetime import datetime | |
class Foo(datetime): | |
def __init__(self): | |
datetime.__init__(self, 2014, 7, 1, 0, 0, 0) | |
obj = Foo() | |
### result: | |
# | |
# Traceback (most recent call last): | |
# File "hoge.py", line 7, in <module> | |
# obj = Foo() | |
# TypeError: Required argument 'year' (pos 1) not found | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment