A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-November/114478.html below:

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

[Python-Dev] how to find the file path to an extension module at init time? [Python-Dev] how to find the file path to an extension module at init time?"Martin v. Löwis" martin at v.loewis.de
Sun Nov 13 21:46:31 CET 2011
> I'm asking specifically because I'd like to properly implement __file__
> in Cython modules at module init time.

Why do you need to implement __file__? Python will set it eventually to
its correct value, no?

> Another problem is that package local imports from __init__.py no longer
> work when it's compiled

Does it actually work to have __init__ be an extension module?

> Any ideas how this could currently be achieved? 

Currently, for Cython? I don't think that can work.

> Or could this become a new feature in the future?

Certainly. An approach similar to _Py_PackageContext should be possible.

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4