[Python-Dev] Syntax suggestion for imports
Simon Percivall
percivall at gmail.com
Thu Jan 3 15:28:54 CET 2008
On 3 jan 2008, at 02.19, Raymond Hettinger 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
Wouldn't a (stdlib) function suffice in the cases where this is needed?
ET = import_with_alternative("xml.etree.CElementTree", "cElementTree",
"elementtree.ElementTree")
It's not as elegant, but it's easier than status quo.
//Simon
More information about the Python-Dev
mailing list