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/2007-July/073760.html below:

[Python-Dev] PEP 366 - Relative imports from main modules

[Python-Dev] PEP 366 - Relative imports from main modules [Python-Dev] PEP 366 - Relative imports from main modulesPhillip J. Eby pje at telecommunity.com
Thu Jul 5 18:24:44 CEST 2007
At 11:53 AM 7/5/2007 +0200, Guido van Rossum wrote:
>I see no big problems with this, except I wonder if in the end it
>wouldn't be better to *always* define __package_name__ instead of only
>when it's in main? And then perhaps rename it to __package__? Done
>properly it could always be used for relative imports, rather than
>parsing __module__ to find the package. Then you won't even need the
>error handler.

+1 for __package__, and putting it everywhere.  Relative import 
should use it first if present, falling back to use of __name__.

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