A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2017-January/147130.html below:

[Python-Dev] Imports with underscores

[Python-Dev] Imports with underscores [Python-Dev] Imports with underscoresBarry Warsaw barry at python.org
Mon Jan 9 11:20:16 EST 2017
On Jan 09, 2017, at 11:42 AM, Steve Holden wrote:

>So I thought it would be useful to get input from current devs about the
>value of this practice, since to me it seems somewhat anti-pythonic. What
>advantages does it confer?

It just means you can't accidentally import it with a from-import-* since
those ignore underscored names by default.

(But then if you use __all__'s it won't happen anyway because you'll never put
'os' in __all__.)

(Aside from the fact that from-import-* is usually bad form, and the problem
with __all__ <wink> [1].)

Cheers,
-Barry

[1] http://public.readthedocs.io/en/latest/#the-problem
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