[docs] [issue10977] Concrete object C API considered harmful to subclasses of builtin types

Nick Coghlan report at bugs.python.org
Fri Oct 25 19:02:44 CEST 2013


Nick Coghlan added the comment:

Keep in mind that part of the problem here is finding stdlib code that
needs to be fixed to handle subclasses correctly. The existing APIs have
permitted use with subclasses for years but are, in fact, the wrong tool
for that in many cases.

The problem to be solved isn't "this code should handle ducktyping" but,
"this code should either reject subclasses or else handle them without
corrupting them". Using the same API for both external invocation and for
subclasses calling up to the parent is a problem. For code in critical
paths, doing the same type check twice is also a problem.

----------

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


More information about the docs mailing list