[Python-Dev] quick poll: could int, str, tuple etc. become type objects?
Tim Peters
tim@digicool.com
Tue, 5 Jun 2001 15:56:59 -0400
Just to reduce this to its most trivial point <wink>,
> - What should the argument to dict() be? A list of (key, value)
> pairs, a list of alternating keys and values, or something else?
the middle one (perhaps generalized to "iterable object alternately
producing keys and values") is most useful in practice. Perl gets a lot of
mileage of that, e.g. think of using re.findall() to build a list of
mail-header field, value, field, value, ... thingies to feed to a dict. A
list of (key, value) pairs is prettiest, but almost nothing *produces* such
a list except for dict.items(); we don't need another way to spell
dict.copy().