[Pyobjc-dev] Re: [Pyobjc-checkins] CVS: pyobjc/Lib/objc/test test_keyvalue.py,1.8,1.9
Brought to you by:
ronaldoussoren
From: Ronald O. <ron...@ma...> - 2004-05-05 18:13:11
|
On 5-mei-04, at 19:55, Bob Ippolito wrote: > Update of /cvsroot/pyobjc/pyobjc/Lib/objc/test > In directory > sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9036/Lib/objc/test > > Modified Files: > test_keyvalue.py > Log Message: > Contrive a bizarre really hard to debug situation that works with the > new > initializer pattern but not the old. > > p.s. Ronald, turn on -O0 before even trying to track it down .. ;) Thanks, that's really helpful. The initializer flag has another side effect that I forgot about, the bridge "knows" that they return self, and that probably causes problems here (and even if it wouldn't this is obviously incorrect for methods that return an object but are not an initializer..., e.g. -(id)initialValue;. We need to recognize that an object is initialized, because of class clusters (e.g. release-ing the result of NSArray.alloc() is not good for your health). I'm going to look at your patch, it probably saner than assuming that all methods whose name starts with init followed by an uppercase letter (or whose name is init) are initializers. > def setBar_(self, value): > + self.initiateDestructionSequence() # to_objc(self) == nil at this point > self._kvo_bar = value > setBar_ = objc.accessor(setBar_) I can't wait until we can write this as 'def setBar_(self, value) [obj.accessor]:'. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |