[issue19331] Revise PEP 8 recommendation for class names

Antoine Pitrou report at bugs.python.org
Thu Oct 24 11:19:21 CEST 2013


Antoine Pitrou added the comment:

> In cases where inheritance is not encouraged and it is judged to improve
> readability at the point of use, the naming convention for callables
> (lower_case_with_underscores) may be used instead. This is an indication
> that the type is intended primarily for use "as is", rather than through
> inheritance (although subclassing is still permitted).

I don't think this wording is appropriate.

As soon as the "thing" is documented as a *type* (i.e. something you call to get instances that have a specific interface - methods, etc.), then IMO it should follow the naming scheme for classes.
Only when the "thing" is not documented as a type but as a convenience callable (for example a context manager) is it reasonable to follow the naming scheme for functions.

In other words, this has nothing to do with subclassing.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19331>
_______________________________________


More information about the Python-bugs-list mailing list