Nick Coghlan added the comment:

Documenting it as a callable is a pretty strong hint that it shouldn't be 
subclassed, but I agree my wording above is wrong. Next attempt (leaving out 
the mention of leading underscores, since that is covered elsewhere):

=================
Class Names
-----------

Class names should normally use the CapWords convention.

The naming convention for functions may be used instead in cases where the 
interface is documented and used primarily as a callable.

Note that there is a separate convention for builtin names: most builtin names 
are single words (or two words run together), with the CapWords convention used 
only for exception names and builtin constants.
=================

I initially had the following appended to the second paragraph: "... , and 
instances expose no public mutable attributes or instance methods (but may 
provide read-only data attributes, alternative constructors and appropriate 
special methods)".

The longer phrasing was designed to explicitly cover 
itertools.chain.from_iterable, contextlib.redirect_stdio.target and 
contextlib.suppress.exceptions, but I don't think that level of detail is 
necessary.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19331>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to