2007/10/19, Christian Heimes <[EMAIL PROTECTED]>:

> I know a possible solution. You could write a patch that moves the
> imports in C code to the module init function and stores the modules in
> a global static variable.

I thought about this. It even will have the good side efect of not
shooting the whole "import" machinery to see that you already imported
it, every time you do an strptime.

One question: The program makes this:

    PyObject *strptime_module = PyImport_ImportModule("_strptime");
    ...
    Py_DECREF(strptime_module);

If I'd import it in the beggining of the file with the following...

    static PyObject *strptime_module = PyImport_ImportModule("_strptime");

... I'd never decref it, right?

Thank you!

-- 
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
_______________________________________________
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