Re: [Pyobjc-dev] More on integer values
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-02-03 07:14:48
|
On Monday, Feb 3, 2003, at 04:35 Europe/Amsterdam, bb...@ma... wrote: > On Sunday, Feb 2, 2003, at 21:08 US/Eastern, David Eppstein wrote: >> If they're not interchangeable, then maybe it's a bug that calling >> into and back from the undo manager is changing my ints into >> integers? The point is, I'm passing it arguments that should work, >> and it's giving me back ones that don't work. > > The underlying problem is that the bridge has no way of knowing the > signature of the method your are invoking upon > prepareWithInvocationTarget_() and, as such, assumes everything passed > into that method is an int. is and object [ed.] ;-) [explanation of how NSUndoManager works removed for brevity] > At least, I think it does. Thats right. > > Fixing it may be hard. Not too hard. There are (at least) two possible solutions: - David could use objc.selector to specify a signature that is more to its liking (e.g. one of the arguments is an int instead of an object). I don't really like this, mostly because of the arcane interface of selector() - We could treat NSNumber like a Python number when translating arguments to Objective-C values. Doing that would not be too hard. Or we could translate NSNumbers to Python numbers when translating from Objective-C values to Python values, but I don't think we should do that. Ronald |