[Pyobjc-dev] Fwd: [Pythonmac-SIG] Towards PyObjC 3.0
Brought to you by:
ronaldoussoren
From: Nicholas C. <nic...@gm...> - 2014-06-04 06:59:27
|
On Wed, Jun 4, 2014 at 12:46 AM, Greg Ewing <gre...@ca...> wrote: > counter.incrementBy(2, numberOfTimes: 7) > > It doesn't explicitly say at that point, but I strongly suspect that > you *have* to call it *exactly* like that, and not any of these ways: > > counter.incrementBy(2, 7) > counter.incrementBy(amount: 2, numberOfTimes: 7) > counter.incrementBy(numberOfTimes: 7, amount: 2) > > In other words, it's just syntactic sugar for an Objective-C method > call, and not a true keyword-argument system. Which is rather disappointing, > and doesn't help at all with interfacing to Python. The manual says that this is optional, and that you can define the first argument as a keyword one. You can also define default values, so perhaps it is not quite as restrictive as you fear. The first-arguemt-is-by-default-not-a-keyword is the kind of thing that makes sense now, as developers move from Obj-C, but surely is going to feel very odd if swift ever catches on. |