super() ã§ã®çå
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
解決 ï¼mechanize.Browser ã object ãç¶æ¿ããªãå¤ãã¿ã¤ãã®ã¯ã©ã¹ã ã£ãã¿ãã
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
ãã㯠OK
>>> class Foo(object): def __init__(self,text): super(Foo,self).__init__(self) ... >>> foo = Foo('test')
ã§ãmechanize.Browser ç¶æ¿ãã¦è¦ªã®ã³ã³ã¹ãã©ã¯ã¿å¼ã¼ãã¨ããã
>>> import mechanize >>> class MyBrowser(mechanize.Browser): ... def __init__(self,userid,passwd): ... super(MyBrowser,self).__init__(self) ... >>> foo = MyBrowser('test','test') ------------------------------------------------------------ Traceback (most recent call last): File "<ipython console>", line 1, in <module> File "<ipython console>", line 3, in __init__ TypeError: super() argument 1 must be type, not classobj
ãªãã§ï¼ï¼ï¼ï¼
æãã¦ã¨ãã人ï¼ï¼ï¼
... super(MyBrowser,self).__init__(self)
ã
... mechanize.Browser.__init__(self)
ã«ããã°åããã ãã©ããªãããã¢ã¤ãªãï¼ï¼