Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!news.muarf.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'argument': 0.05; 'subject:Python': 0.06; 'method:': 0.09; 'received:151': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'skip:o 50': 0.09; 'underscore': 0.09; '1.x': 0.16; 'arg2,': 0.16; 'emanuele': 0.16; 'kwargs': 0.16; 'ordereddict': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Java': 0.16; 'wrote:': 0.18; "python's": 0.19; '>>>': 0.22; 'header:User- Agent:1': 0.23; 'equivalent': 0.26; 'header:X-Complaints-To:1': 0.27; 'that.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'writes:': 0.31; 'actual': 0.34; 'could': 0.34; 'subject: (': 0.35; 'something': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; '(we': 0.36; '+0200,': 0.36; 'doing': 0.36; 'method': 0.36; 'too': 0.37; 'being': 0.38; 'initially': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'even': 0.60; 'che': 0.60; 'map': 0.64; 'side': 0.67; 'close': 0.67; 'wish': 0.70; 'quando': 0.84; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Lele Gaifax Subject: Re: Python was designed (was Re: Multi-threading in Python vs Java) Date: Wed, 23 Oct 2013 17:56:54 +0200 Organization: Nautilus Entertainments References: <0a9761bd-4f1c-48a9-a3c5-9424f2e99f2e@googlegroups.com> <7b1b5852-a213-4a45-bb9b-2a840c183a57@googlegroups.com> <52648c54$0$29981$c3e8da3$5496439d@news.astraweb.com> <526785c1$0$30000$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 151.62.78.202 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:WPY9tyDujqRgiPqa47JXXt2YZTM= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382543829 news.xs4all.nl 15867 [2001:888:2000:d::a6]:47992 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57372 Gregory Ewing writes: > Steven D'Aprano wrote: >> On Tue, 22 Oct 2013 09:38:16 +0200, Lele Gaifax wrote: >> >>>The actual syntax would be >>> >>> [object method: arg1 withSomething: arg2 withSomethingElse: arg3] >> >> I don't get how to map that to Python's syntax. > > It's roughly morally equivalent to > > object.method(arg1, withSomething = arg2, withSomethingElse = arg3) > > But there are several reasons why it's not really equivalent > to that. PyObjC actually maps it to > > object.method_withSomething_withSomethingElse_(arg1, arg2, arg3) > > which is very close to what Objective C is doing under the hood. Right (IIRC, I initially used a double underscore as separator), and that's because in ObjC the method [object method:arg1 withSomething:arg2 withSomethingElse:arg3] is completely unrelated to [object method:arg1 withSomethingElse:arg3 withSomething:arg2] I wish I had a way, at the time (we were in the 1.x era), to use something like OrderedDict to carry around the kwargs argument of a function/method, that could let me use a nicer syntax... I did even cook-up a quick&dirty patch, but being too biased toward the "dirty" side it did not go too far. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. lele@metapensiero.it | -- Fortunato Depero, 1929.