2.6, 3.0, and truly independent intepreters

"Martin v. Löwis" martin at v.loewis.de
Sat Oct 25 09:01:29 CEST 2008


> If Py_None corresponds to None in Python syntax (sorry I'm not familiar
> with Python internals yet; glad you are commenting, since you are), then
> it is a fixed constant and could be left global, probably.

If None remains global, then type(None) also remains global, and
type(None),__bases__[0]. Then type(None).__bases__[0].__subclasses__()
will yield "interesting" results. This is essentially the status quo.

> But if we
> want a separate None for each interpreter, or if we just use Py_None as
> an example global variable to use to answer the question then here goes

There are a number of problems with that approach. The biggest one is
that it is theoretical. Of course I'm aware of thread-local variables,
and the abstract possibility of collecting all global variables in
a single data structure (in fact, there is already an interpreter
structure and per-interpreter state in Python). I wasn't claiming that
it was impossible to solve that problem - just that it is not simple.
If you want to find out what all the problems are, please try
implementing it for real.

Regards,
Martin



More information about the Python-list mailing list