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/2008-January/075796.html below:

[Python-Dev] Syntax suggestion for imports

[Python-Dev] Syntax suggestion for importsMichael Urman murman at gmail.com
Thu Jan 3 07:56:51 CET 2008
On Jan 2, 2008 7:19 PM, Raymond Hettinger <python at rcn.com> wrote:
> How about a new, simpler syntax:
>
> * import threading or dummy_threading as threading
>
> * import xml.etree.CElementTree or cElementTree or elementree.ElementTree as ET
>
> * from cStringIO or StringIO import StringIO
>
> * import readline or emptymodule

I'm sympathetic to this syntax proposal, as I find the repetition and
extra lines for a simple idea to be a little unpleasant. This would
also allow us to decide whether the import 'or' handling would be
triggered equivalently to the except ImportError case you described,
or only for missing imports. The latter would stop errors in existing
modules from being silenced (and may give reason to allow emptymodule
or None), but I'm unsure if that's a good thing.

Of the above I find the ElementTree migration to be the most
compelling, yet it seems ill-timed to bring syntax into Python 2.x
you'd be unable to use until you no longer needed it. However your
later example of the PageTemplateFile, which appears to be due to a
third-party module reorganization and could certainly happen during
the lifetime of late 2.x, helps swing me back the other way.

-- 
Michael Urman
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