[docs] [issue17279] Document which named built-in classes can be subclassed

Terry J. Reedy report at bugs.python.org
Sun Feb 24 02:53:01 CET 2013


Terry J. Reedy added the comment:

Such a list might differentiate between classes that are intentionally not subclassed and those for which subclassing simply has not yet been enabled. That might help eliminate the latter list.

When I suggested on the python-ideas 'range' thread that people should best get what they wanted with a range subclass, if that were made possible, Nick C. replied "I wasn't even aware you *couldn't* subclass it (I'd never tried).". Indeed, why would he with no doc.

The types module doc could also use an addition.
Attached subclassable.py produces these lists:
Among named builtin classes, these cannot be subclassed:
bool, memoryview, range, slice, 
Among types classes, these can be subclassed:
ModuleType, SimpleNamespace,

----------
Added file: http://bugs.python.org/file29216/subclassable.py

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


More information about the docs mailing list