Why is Python popular, while Lisp and Scheme aren't?
Alexander Schmolck
a.schmolck at gmx.net
Mon Nov 25 08:49:38 EST 2002
"Terry Reedy" <tjreedy at udel.edu> writes:
> There was much discussion about which of dict.iterkeys(), iteritems(),
> or itervalues() should be the default for 'in dict' both for 'if key
> in dict' and 'for key in dict'. Note that since 'in seq' means same
> sequence in both contexts for other containers (and same underlying
> code is used to get sequence) it was wanted to keep 'in dict' meaning
> same also. The consensus, considering use cases for both
> constructions, was that keys are most ofter what is wanted.
Thanks for pointing that out. This argument certainly carries weight,
especially given that I can think of no straighforward test for
key-membershipunder the "more unified" scheme using the "in" syntax (e.g. in
dict.keys() is obviously a no-op).
alex
More information about the Python-list
mailing list