[issue3760] PEP 3121 --- PyType_Copy is missing

Martin v. Löwis report at bugs.python.org
Sun Sep 7 21:28:35 CEST 2008


Martin v. Löwis <martin at v.loewis.de> added the comment:

The intention is that different interpreters have distinct, separate
instances of the type objects. This is desirable in case of class
variables, and standard for Python-defined types. Clearly, 3.0 won't
provide that separation for many of the builtin types (and never may);
for out-of-core types, it is really the choice of the module designer.

I forgot to implement PyType_Copy; it is meant to create a new type
object which is a field-by-field copy. It's now too late to add it to
3.0; extension authors requiring it now should include it's source code
(which is currently not even written - contributions are welcome).

Reconsidering it: what should it do to the base types? 
 a) just incref tp_base and clone tp_bases, 
 b) offer an optional parameter to specify an alternative base object, 
 c) offer an optional parameter to specify an alternative bases tuple.

----------
priority: high -> normal

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


More information about the Python-bugs-list mailing list