Re: [Python-Dev] PEP 309 enhancements

2005-02-26 Thread Paul Moore
On Sat, 26 Feb 2005 16:50:06 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Moving a discussion from the PEP309 SF tracker (Patch #941881) to here, since > it's gone beyond the initial PEP 309 concept (and the SF tracker is a lousy > place to have a design discussion, anyway). > > The discussion

Re: [Python-Dev] PEP 309 enhancements

2005-02-26 Thread Nick Coghlan
Paul Moore wrote: Personally, I'd rather see partial as it stands, with its current limitations, included. The alternative seems to be a potentially long discussion, petering out without conclusion, and the whole thing missing Python 2.5. (I know that's a long way off, but this already happened wi

[Python-Dev] pystone

2005-02-26 Thread stelios xanthakis
Hi, It seems that in pystone, Proc1 the else branch is never reached. Is this OK ?? Stelios ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-de

[Python-Dev] PEP 309

2005-02-26 Thread Raymond Hettinger
Paul Moore wrote: > Personally, I'd rather see partial as it stands, with its current > limitations, included.  The alternative seems to be a potentially long > discussion, petering out without conclusion, and the whole thing > missing Python 2.5. (I know that's a long way off, but this already > h

Re: [Python-Dev] PEP 309

2005-02-26 Thread Paul Moore
On Sat, 26 Feb 2005 13:20:46 -0500, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > It is better to teach how to write a closure than to introduce a new > construct that has its own problems and doesn't provide a real > improvement over what we have now. You make some good points. But this all remi

RE: [Python-Dev] PEP 309

2005-02-26 Thread Raymond Hettinger
> But this all reminds me of the discussion > over itemgetter/attrgetter. They also special-case particular uses of > lambda, and in those cases the stated benefits were speed and > (arguably) readability (I still dislike the names, personally). I wouldn't use those as justification for partial().

RE: [Python-Dev] PEP 309

2005-02-26 Thread Raymond Hettinger
> I did a quick experiment: > > >python -m timeit -s "from operator import itemgetter; l=range(8)" > "itemgetter(1)(l)" > 100 loops, best of 3: 0.548 usec per loop > > >python -m timeit -s "l=range(8)" "(lambda x:x[1])(l)" > 100 loops, best of 3: 0.597 usec per loop > > That's far less o

Re: [Python-Dev] PEP 309

2005-02-26 Thread Steven Bethard
On Sat, 26 Feb 2005 19:26:11 -0500, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > Are you sure about that? Contriving examples is easy, but download a > few modules, scan them for use cases, and you may find, as I did, that > partial() rarely applies. The argument order tends to be problematic.

Re: [Python-Dev] PEP 309

2005-02-26 Thread Nick Coghlan
Raymond Hettinger wrote: * The PFA implementation proposed for Py2.4 ran slower than an equivalent closure. If the latest implementation offers better performance, then that may be a reason for having it around. Not having done the timing, I'll defer to Paul and yourself here. However, one of the

Re: [Python-Dev] PEP 309

2005-02-26 Thread Dima Dorfman
Nick Coghlan <[EMAIL PROTECTED]> wrote: > Raymond Hettinger wrote: > >* The instance method limitation never came up for me. However, it > >bites to have a tool working in a way that doesn't match your mental > >model. We have to document the limitations, keep them in mind while > >programming, a

Re: [Python-Dev] PEP 309

2005-02-26 Thread Nick Coghlan
Dima Dorfman wrote: Nick Coghlan <[EMAIL PROTECTED]> wrote: Here, b is specialized at cut time, a is passed through the slot, and c is passed through the implicit slots at the end. The only thing this can't do is a generic right-"curry"--where we don't know how many parameters come before the one w