2.6, 3.0, and truly independent intepreters

"Martin v. Löwis" martin at v.loewis.de
Fri Oct 24 21:40:13 EDT 2008


> It seems to me that the very simplest move would be to remove global
> static data so the app could provide all thread-related data, which
> Andy suggests through references to the QuickTime API. This would
> suggest compiling python without thread support so as to leave it up
> to the application.

I'm not sure whether you realize that this is not simple at all.
Consider this fragment

    if (string == Py_None || index >= state->lastmark ||
!state->mark[index] || !state->mark[index+1]) {
        if (empty)
            /* want empty string */
            i = j = 0;
        else {
            Py_INCREF(Py_None);
            return Py_None;

Py_None here is a global variable. How would you replace it?
It's used in thousands of places.

For another example, consider

                PyErr_SetString(PyExc_ValueError,
                                "Empty module name");
or

        dp = PyObject_New(dbmobject, &Dbmtype);

There are tons of different variables denoting exceptions and
other types which all somehow need to be rewritten (likely with
undesirable effects on readability).

So I don't think that this is a simple solution. It's the right
one, but it will take five or ten years to implement.

Regards,
Martin



More information about the Python-list mailing list