Re: [Pyobjc-dev] Default to returning (void)?
Brought to you by:
ronaldoussoren
From: b.bum <bb...@ma...> - 2004-02-16 05:04:17
|
On Feb 15, 2004, at 8:36 PM, Bob Ippolito wrote: > At least in Python 2.3.x, the only way to generate "LOAD_CONST 0 > (None) / RETURN_VALUE" is either a bare return, or no return at all. > If you analyze the bytecode for a function, and it has no other > RETURN_VALUE pairs.. then you can safely assume that it should default > to void. Eeeewwwww.... Nuts. Defaulting to a (void) return will break for any getter, so I can see how trying to figure this out to do the right thing would be preferable. Barring automated intelligence, being able to do something like the following would be preferable to the crypting exposed signatures we have today. def setContent_(self, someContent): print "Setting content...." self._content = someContent setContent_ = selector(setContent_, type='setter') objc.makeSetter(setContent_) # this would be even better def takeAction_(self, sender): pass takeAction_ = selector(takeAction_, type='action') |