[Python-Dev] how to find the file path to an extension module at init time?

Nick Coghlan ncoghlan at gmail.com
Mon Nov 14 12:10:49 CET 2011


On Mon, Nov 14, 2011 at 6:18 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:
>> Certainly. An approach similar to _Py_PackageContext should be possible.
>
> Yes, and a "_Py_ModuleImportContext" would be rather trivial to do. Could
> that go into 3.3? What about 2.7? Could an exception be made there regarding
> new "features"? It's not likely to break anything, but it would help Cython.

Hmm, interesting call - fixing this doesn't actually require a new
public API, since it's just a new data attribute protected by the
import lock that is used to pass state information from importdl.c to
moduleobject.c. I'm inclined to say "no" myself, but it's a close run
thing.

So +1 for fixing it in 3.3, and -0 for calling it a bug rather than a
missing feature and also fixing it in 2.7

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list