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/2010-July/101837.html below:

[Python-Dev] avoiding accidental shadowing of top-level libraries by the main module

[Python-Dev] avoiding accidental shadowing of top-level libraries by the main module [Python-Dev] avoiding accidental shadowing of top-level libraries by the main moduleNick Coghlan ncoghlan at gmail.com
Tue Jul 13 00:23:04 CEST 2010
On Tue, Jul 13, 2010 at 8:06 AM, Michael Foord
<fuzzyman at voidspace.org.uk> wrote:
> An explicit error being raised instead would be just as good.

Ah, refusing the temptation to guess.

So the idea would be, when attempting to import __main__ under it's
original name:
3.2 issue a DeprecationWarning
3.3 raise ImportError

It still strikes me as wrong for the base import implementation, but
PEP 302 may provide a mechanism for an interpreter shell to add its
own "newbie protection" hooks (and that would have the virtue of being
available much earlier and with a much lower chance of breaking
anything).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
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