On Mon, Mar 2, 2009 at 3:13 PM, Raymond Hettinger <pyt...@rcn.com> wrote: > >> Unfortunately PEP 8 never really took off naming-wise, so we're mostly >> following >> 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 etc.). 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 NamedDict? -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com