On Wed, Jan 02, 2008, Raymond Hettinger wrote: > > The standard library, my personal code, third-party packages, and > my employer's code base are filled with examples of the following > pattern: > > try: > import threading > except ImportError: > import dummy_threading as threading > > How about a new, simpler syntax: > > * import threading or dummy_threading as threading My gut reaction is -0. For starters, many of these should go away with Python 3.0 (e.g. cStringIO). Also, annoying as the try/except is, I think the fact that it signals the special import is helpful; your suggestion is too light-weight IMO. If you could devise something just a bit heavier, that would be much better. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ Weinberg's Second Law: If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.
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