Why is Python popular, while Lisp and Scheme aren't?
Michael Hudson
mwh at python.net
Mon Nov 25 06:19:30 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. Think 'is
> word in dictionary' rather than 'is word,definition in dictionary'.
> Normal use of phonebook is similar.
For what it's worth (not much) I'm forever writing
for k, v in d:
....
I can see the arguments for consistency, but I think this is my most
reliable Python error at the moment.
Cheers,
M.
--
: Giant screaming pieces of excrement, they are.
I have a feeling that some of the people in here have a
MUCH more exciting time relieving themselves than I do.
-- Mike Sphar & Dave Brown, asr
More information about the Python-list
mailing list