Why is Python popular, while Lisp and Scheme aren't?

Terry Reedy tjreedy at udel.edu
Sat Nov 23 19:30:34 EST 2002


"Alexander Schmolck" <a.schmolck at gmx.net> wrote in message
news:yfsadk0c648.fsf at black132.ex.ac.uk...
>> [Aside: the fact that for python dicts one iterates over keys
rather than
> values seems like a wart to me, most likely caused by the absence of
a set
> type (now in 2.3), and the consequent frequent abuse of dicts to
represent
> sets. The resultant unnecessary discrepancy between the interfaces
of mapping
> and sequence types is somewhat annoying.]

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.

Terry J. Reedy





More information about the Python-list mailing list