Re: [Pyobjc-dev] Objective-P?
Brought to you by:
ronaldoussoren
From: Orestis M. <or...@or...> - 2009-11-12 11:17:24
|
On 12 Nov 2009, at 11:59, Ronald Oussoren wrote: > What really annoys me though is that I haven't been able to find a way to get clear integration of Cocoa and Python without changing the Python syntax, and without using manual translation of method names (as was used by the Java-Cocoa bridge). I've given some thought to that in the past, and of course I know it comes up on the list every couple of months. I think an important step is maintaing the order of the **kwargs dictionary: def set(self, **kwargs): # construct method name from kwargs # extract positional args from kwargs objc.dispatch(methodname, args) foo.set(Value=1, forKey='a') foo.set(forKey='a', Value=1) If those calls could be differentiated in the body of 'set', would it not help? Some cases could be ambiguous, but in that case a warning could be emitted and the current convention could be used instead. Orestis |