Last active
August 26, 2018 18:45
-
-
Save vmaks/17ab06089186d5c1b3bf to your computer and use it in GitHub Desktop.
python super TypeError: must be type, not classobj
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
If you face with an error like this while use "super": | |
"TypeError: must be type, not classobj" | |
link: | |
http://stackoverflow.com/questions/489269/python-super-raises-typeerror-why | |
Solution: add inheratence from the "object" class in the base class. | |
class Class1(object): | |
def __init__(self): | |
pass | |
class Class2(Class1): | |
def __init__(self): | |
super(Class2, self).__init__() | |
super(self.__class__, self).__init__() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment