[Python-Dev] synchronized enumerate

2005-12-19 Thread Chris or Leslie Smith
I see that there is a thread of a similar topic that was posted recently ( enumerate with a start index ) but thought I would start a new thread since what I am suggesting is a little different. Whenever I use enumerate, I am doing so because I will use the index to access some other element

Re: [Python-Dev] synchronized enumerate

2005-12-19 Thread Aahz
On Sun, Dec 18, 2005, Chris or Leslie Smith wrote: What I would propose is an optional slice argument to the enumerate routine that would allow enumerate to return elements that are synchronized with the original list list/iterable elements. e.g. python-dev is the wrong place to start

Re: [Python-Dev] Expose Subversion revision number to Python

2005-12-19 Thread John Pinner
Barry Warsaw wrote: On Sun, 2005-12-18 at 19:19 +0100, Martin v. L?wis wrote: It stopped counting builds on Windows quite some time ago; perhaps it is best to drop the build number entirely? I think so, because it doesn't really convey anything useful. I thought it was more succinct

[Python-Dev] Keep default comparisons - or add a second set?

2005-12-19 Thread Jim Jewett
PEP 3000 now suggests that dropping default comparison has become more than an idle what-if. Unfortunately, one very common use case of comparisons is to get a canonical order. If the order is sensible, all the better, but that is not strictly required. One of Python's selling points

Re: [Python-Dev] Keep default comparisons - or add a second set?

2005-12-19 Thread Paul Moore
On 12/19/05, Jim Jewett [EMAIL PROTECTED] wrote: Unfortunately, one very common use case of comparisons is to get a canonical order. If the order is sensible, all the better, but that is not strictly required. One of Python's selling points (especially compared to Java) is that getting a

Re: [Python-Dev] synchronized enumerate

2005-12-19 Thread Nick Coghlan
Chris or Leslie Smith wrote: Whenever I use enumerate, I am doing so because I will use the index to access some other element in the list (the previous or next, usually) while also looking at the element that is returned from enumerate. Several times, however, in the development phase of the

Re: [Python-Dev] synchronized enumerate

2005-12-19 Thread Raymond Hettinger
[Chris or Leslie Smith] I see that there is a thread of a similar topic that was posted recently ( enumerate with a start index ) but thought I would start a new thread since what I am suggesting is a little different. Try rolling your own with izip() and count(): izip(count(start),

Re: [Python-Dev] Keep default comparisons - or add a second set?

2005-12-19 Thread Greg Ewing
Jim Jewett wrote: Or, at the very least, promote a *standard* way to say just get me a canonical ordering of some sort That would be my preference. Comparison for canonical ordering should be a distinct operation with its own spelling. Then Guido's Comparisons other than == and !=

Re: [Python-Dev] Keep default comparisons - or add a second set?

2005-12-19 Thread Michael Urman
On 12/19/05, Greg Ewing [EMAIL PROTECTED] wrote: That would be my preference. Comparison for canonical ordering should be a distinct operation with its own spelling. Such as sorted(stuff, key=id)? Michael -- Michael Urman http://www.tortall.net/mu/blog

Re: [Python-Dev] Keep default comparisons - or add a second set?

2005-12-19 Thread Josiah Carlson
Michael Urman [EMAIL PROTECTED] wrote: On 12/19/05, Greg Ewing [EMAIL PROTECTED] wrote: That would be my preference. Comparison for canonical ordering should be a distinct operation with its own spelling. Such as sorted(stuff, key=id)? I believe that ideally, canonical orderings