[].keys() and [].items() (Was: Why I think range is a wart)
Jonathan Gardner
jgardn at alumni.washington.edu
Wed Mar 13 19:45:27 EST 2002
Clark C . Evans scribbled with his keyboard:
> On Wed, Mar 13, 2002 at 11:34:55AM -0500, ruud de rooij wrote:
> | perhaps lists should support .keys() and .items() for those operations
> | (analogous to dictionaries).
>
> 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.
>
It certainly provides a feature I would use often.
Jonathan
More information about the Python-list
mailing list