[Python-Dev] Re: PEP 279 revisited (original) (raw)

Raymond Hettinger python@rcn.com
Wed, 24 Apr 2002 00:47:25 -0400


From: "Guido van Rossum" <guido@python.org>

There's one nagging issue that I'd like to revisit. I think I still like the name itemize() better than enumerate(), I'm ready to open this one for a vote. :-)

One other thought. As a design principle (from The Design of Everyday Things), knowledge of what something does and how to use it should be embedded in the object not in the user.

In this case, a person can learn to use either itemize() or enumerate() and bring that knowledge with them when they program. However, if the knowledge is not there (newbies), rusty (occasional users), or ambiguated (users of multiple languages), then the question arises of whether the name tells us what it does. For this reason, I vote for any name which suggests that numbers are going to come out.

An arbitrary enumerate() function is clearly going to create numbers while an itemize() found in the wild could potentially do something non-numeric. So while I could personally get used to either name and be happy, I think enumerate's two extra letters or one extra syllable is worth it.

'nuff said,

Raymond Hettinger