Comment on PEP-0322: Reverse Iteration Methods

Stephen Horne $$$$$$$$$$$$$$$$$ at $$$$$$$$$$$$$$$$$$$$.co.uk
Fri Sep 26 15:42:00 EDT 2003


On Fri, 26 Sep 2003 14:51:05 -0400, David Abrahams
<dave at boost-consulting.com> wrote:

>Alex Martelli <aleax at aleax.it> writes:
>
>> David Abrahams wrote:
>>    ...
>>> Also, the idea of denying tuples the ability to reverse iterate seems
>>> arbitrary and capricious.
>>
>> Sure, but so is denying them, e.g., non-mutating methods such as
>> .index() and .count().
>
>Not IMO. Immutability is a very useful trait.

Yes - and perfectly consistent with having *NON*-mutating methods such
as .index() and .count()  ;-)

I always assumed that these were considered inconsistent with normal
use of tuples (which certainly I rarely need to get 'index' or
'count'-like results from).

Actually, they even seem a little odd in list, to be honest. I'd have
functions, not necessarily even in __builtins__, which work on any
sequence. They just don't seem like everyday operations that should be
built into the object.


-- 
Steve Horne

steve at ninereeds dot fsnet dot co dot uk




More information about the Python-list mailing list