[Python-Dev] Further PEP 8 compliance issues in threading and multiprocessing (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Sep 2 03:04:18 CEST 2008


Antoine Pitrou wrote:

I don't see a problem for trivial functional wrappers to classes to be capitalized like classes.

The problem is that the capitalization makes you think it's a class, suggesting you can do things with it that you actually can't, e.g. subclassing.

I can't think of any reason to do this. If you don't want to promise that something is a class, what possible reason is there for naming it like one?

I can see a reason for doing the opposite, though: if something happens to be a class, but you don't want to promise that, you could expose it under a lower-case name, that can be replaced with a factory function later.

In this case, the thing to decide is whether Event will always be a direct class instantiation. If so, rename _Event to Event and expose it directly. If not, rename Event to event.

-- Greg



More information about the Python-Dev mailing list