Quick question?  Is PEP 8 still current for what is being done in Py3.x?
I just took a quick look and it says:

   Class Names

     Almost without exception, class names use the CapWords convention.
     Classes for internal use have a leading underscore in addition.


----- Original Message ----- From: "Guido van Rossum" <gu...@python.org>
To: "Raymond Hettinger" <pyt...@rcn.com>
Cc: <python-dev@python.org>; "Armin Ronacher" <armin.ronac...@active-4.com>
Sent: Monday, March 02, 2009 3:38 PM
Subject: Re: [Python-Dev] PEP 372 -- Adding an ordered directory to collections 
ready for pronouncement


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

Reply via email to