Jeremy Kloth schrieb:
> 1) is subclassing Python classes in C as a static type supported? Even if 
> they 
> would be declared on the heap, they would be bound to the first loaded Python 
> class.

As you found out: no, this isn't supported.

To work around, you can wrap the extension module with Python module
which invokes an explicit module initialization function; you then need
to lookup the subclasses dynamically (going through
thread_state->interp->modules).

> As to question 2, I'm in the process of prototyping that approach to see if 
> it 
> is feasible in our code and if so, (and people find it useful) I'll attempt 
> to write a PEP for that feature.

I'd like to see the module initialization/finalization be redone for
Python 3, in particular with explicit finalization procedures. If
Python 3 still supports multiple interpreters, this aspect should be
taken into account. Whether there is any chance to add the PEP to 2.x,
I don't know - it needs to be written first.

Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to