[].keys() and [].items() (Was: Why I think range is a wart)

Terry Reedy tejarex at yahoo.com
Wed Mar 13 17:39:02 EST 2002


<James_Althoff at i2.com> wrote in message
news:mailman.1016053344.6398.python-list at python.org...
>
> [ruud de rooij[
> | perhaps lists should support .keys() and .items() for those
operations
> | (analogous to dictionaries).
>
> [Clark C . Evans]
> | Very nice idea.  This is PEP worthy.  It is nice beacuse it
> | does not introduce anything new; a list can easily be viewed
> | as a mapping having a positive integer domain.  This is simple,
> | consistent, and quite elegant.
>
> I would like to see:
>     .keys()
>     .items()
>     .iterkeys()
>     .iteritems()

I like this idea too.  Best suggestion so far for replacing
range(len(skjf))./

Terry J. Reedy






More information about the Python-list mailing list