[Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement
Guido van Rossum
guido at python.org
Tue Mar 3 00:38:41 CET 2009
On Mon, Mar 2, 2009 at 3:13 PM, Raymond Hettinger <python at rcn.com> wrote:
>> Unfortunately PEP 8 never really took off naming-wise, so we're mostly
>> the "reuse the naming scheme from existing code in the same module" rule,
>> and I
>> think there lowercase wins, thanks to defaultdict.
> Traditionally, the all lowercase name referred to a C type. The other
> classes in
> collections are named Counter, UserDict, UserList, UserString,
> MutableMapping, etc.
> Besides, the lowercase/uppercase distinction helps us distinguish functions
> from classes.
> This is the way I've see every Python book do it since the dawn of time.
Then they're all wrong. In 3.0 we're moving away from this, e.g.
cPickle is gone, so is cStringIO. The implementation language should
not shine through. *Maybe* the "built-in status" should guide the
capitalization, so only built-in types are lowercase (str, int, dict
Anyway, it seems the collections module in particular is already
internally inconsistent -- NamedTuple vs. defaultdict. In a sense
defaultdict is the odd one out here, since these are things you import
from some module, they're not built-in. Maybe it should be renamed to
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev