Re: [Python-Dev] [Python-ideas] minmax() function returning (minimum, maximum) tuple of a sequence

2010-10-10 Thread Carl M. Johnson
On Sun, Oct 10, 2010 at 2:55 PM, Zac Burns wrote: > This could be generalized and placed into itertools if we create a function > (say, apply for lack of a better name at the moment) that takes in an > iterable and creates new iterables that yield each from the original > (avoiding the need for a

Re: [Python-Dev] [Python-ideas] minmax() function returning (minimum, maximum) tuple of a sequence

2010-10-10 Thread Zac Burns
This could be generalized and placed into itertools if we create a function (say, apply for lack of a better name at the moment) that takes in an iterable and creates new iterables that yield each from the original (avoiding the need for a list) holding only one in memory. Then you could pass the w

Re: [Python-Dev] [Python-ideas] minmax() function returning (minimum, maximum) tuple of a sequence

2010-10-10 Thread Benjamin Peterson
2010/10/10 Antoine Pitrou : > Personnally, I'm not convinced that a maximum 25% improvement on a > rather uncommon use case (min() and max() on a sequence of objects > which take a long time to compare) is a compelling argument for a > builtin.  On the other hand, it would be a rather simple and in

Re: [Python-Dev] Relative imports in Py3k

2010-10-10 Thread R. David Murray
> On Sun, 10 Oct 2010 18:54:20 +0300, anatoly techtonik > wrote: > > (The explanation of the failures applies for all Python versions that > > I am aware of, but the -m based fix only became available in 2.6) > > (The impact of various command line options and the PYTHONPATH > > environment varia

Re: [Python-Dev] [Python-ideas] minmax() function returning (minimum, maximum) tuple of a sequence

2010-10-10 Thread Steven D'Aprano
On Mon, 11 Oct 2010 05:57:21 am Paul McGuire wrote: > Just as an exercise, I wanted to try my hand at adding a function to > the compiled Python C code. An interesting optimization that I read > about (where? don't recall) finds the minimum and maximum elements of > a sequence in a single pass, wi

Re: [Python-Dev] [Python-ideas] minmax() function returning (minimum, maximum) tuple of a sequence

2010-10-10 Thread Antoine Pitrou
On Sun, 10 Oct 2010 13:57:21 -0500 "Paul McGuire" wrote: > > Any comments? Interest? Should I write up a PEP? Go back to my pyparsing > hole? Generally, these things are discussed on python-ideas first. I don't think a PEP required for a single function, but you'll have to convince people that

Re: [Python-Dev] [Python-ideas] minmax() function returning (minimum, maximum) tuple of a sequence

2010-10-10 Thread Martin v. Löwis
> Any comments? For 3.2, this is out of scope, because of the moratorium. For later versions, I'd rather not see a builtin name polluting the global namespace for this. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.pytho

[Python-Dev] [Python-ideas] minmax() function returning (minimum, maximum) tuple of a sequence

2010-10-10 Thread Paul McGuire
Just as an exercise, I wanted to try my hand at adding a function to the compiled Python C code. An interesting optimization that I read about (where? don't recall) finds the minimum and maximum elements of a sequence in a single pass, with a 25% reduction in number of comparison operations: - the

Re: [Python-Dev] Relative imports in Py3k

2010-10-10 Thread anatoly techtonik
On Sun, Sep 26, 2010 at 2:32 PM, Nick Coghlan wrote: >> >> I wonder if situation with relative imports in packages is improved in >> Python 3k or >> we are still doomed to a chain of hacks? This is The question. Is Python 3k more friendly to users or require them to learn the "zen of import" (whi

Re: [Python-Dev] Relative imports in Py3k

2010-10-10 Thread anatoly techtonik
On Sat, Sep 25, 2010 at 4:52 PM, Georg Brandl wrote: >> >> I wonder if situation with relative imports in packages is improved in >> Python 3k or we are still doomed to a chain of hacks? >> >> My user story: ... >> PEP 328 http://www.python.org/dev/peps/pep-0328/  proposes: >> >> from ... import c

[Python-Dev] Allow registered users to link bugs

2010-10-10 Thread anatoly techtonik
Can anybody remind me why we don't allow registered tracker users to link dependent bugs between each other? -- anatoly t. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pytho

Re: [Python-Dev] Build failure in test_cmd_line on OSX-x86

2010-10-10 Thread Nick Coghlan
On Sun, Oct 10, 2010 at 5:54 PM, Antoine Pitrou wrote: > >> If someone wants to throw an issue my way, I can take a look at >> dumping stdout/stderr from the various test_cmd_line tests (I may not >> get to it until post-beta1 though). > > It's done in r85324. Even better :) Cheers, Nick. -- N

Re: [Python-Dev] Build failure in test_cmd_line on OSX-x86

2010-10-10 Thread Antoine Pitrou
> If someone wants to throw an issue my way, I can take a look at > dumping stdout/stderr from the various test_cmd_line tests (I may not > get to it until post-beta1 though). It's done in r85324. Regards Antoine. ___ Python-Dev mailing list Python-