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
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
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
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
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
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
[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),
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 !=
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
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
10 matches
Mail list logo