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

Gonçalo Rodrigues op73418 at mail.telepac.pt
Wed Mar 13 17:23:02 EST 2002


On Wed, 13 Mar 2002 13:01:13 -0800, James_Althoff at i2.com wrote:

>
>[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()
>
>jim
>

The same idea should be extended to any sequence, actually.

Gonçalo Rodrigues.




More information about the Python-list mailing list