On PEP 322 (ireverse)

David Mertz mertz at gnosis.cx
Thu Oct 30 13:41:49 EST 2003


|> I'm +1 on iter.reversed, along with list.sorted.

"Raymond Hettinger" <vze4rx4y at verizon.net> wrote previously:
|list.sorted() is entirely unrelated.  It is attached to lists because that
|is what it generally returns and because its functionality is closely
|tied to list.sort().

Regardless of the connection to list.sorted(), I'm -1 on a built-in
'reversed()' (or whatever name).

But I'd be +1 on a function or method that lived in either the itertools
modules, or as a member of a classified iter().

There's been WAY too much pollution of the builtin namespace lately.
'reversed()' is nice enough to have not too far away, but not nearly
common enough to need as a builtin.

In fact, I find at least the following anathema in the same way:
enumerate(), sum(), zip(), xrange().  I'm probably forgetting some more.
I'd love to have these in itertools (or maybe sum() could be in math).
But teaching extra builtins is a pain... as is explaining arbitrary
distinctions between what's builtin and what's in itertools.  I think if
I had my druthers, I might even put iter() in itertools.

|Grafting this onto iter is not an option; I would rather lose the
|functionality than have the experts here twist it into something
|I can't easily explain to a client.

Hmmm... that's EXACTLY the reason that I DON'T want it as a builtin.

Yours, Lulu...

--
mertz@  | The specter of free information is haunting the `Net!  All the
gnosis  | powers of IP- and crypto-tyranny have entered into an unholy
.cx     | alliance...ideas have nothing to lose but their chains.  Unite
        | against "intellectual property" and anti-privacy regimes!
-------------------------------------------------------------------------






More information about the Python-list mailing list