Re: [Pyobjc-dev] Exceptions on calling super
Brought to you by:
ronaldoussoren
From: Aahz <aa...@py...> - 2009-09-18 19:35:42
|
On Thu, Sep 17, 2009, Dirk Stoop wrote: > > We recently moved our app from PyObjC 1.4 to 2.2 and now get a lot of > exceptions like this: > > TypeError??: super(type, obj): obj must be an instance or subtype of > type > > These happen in any Python subclass of a Cocoa superclass, but only > occasionally. I'm not completely clear how to reproduce the issue, > but it only happens when we override an initializer and have a call to: > > super(classNameOfOurSubClass, self).init() # or any other initializer. > > Does anyone have a clue what might be going on? That message pretty clearly means that a classic class is getting injected somehow. Consider this:: class C: def foo(self): super(C, self) C().foo() Which version of Python? -- Aahz (aa...@py...) <*> http://www.pythoncraft.com/ "I won't accept a model of the universe in which free will, omniscient gods, and atheism are simultaneously true." --M |