[Python-Dev] Syntax suggestion for imports (original) (raw)
Aahz aahz at pythoncraft.com
Thu Jan 3 19:11:58 CET 2008
- Previous message: [Python-Dev] Syntax suggestion for imports
- Next message: [Python-Dev] Return type of round, floor, and ceil in 2.6
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Jan 02, 2008, Raymond Hettinger wrote:
Before posting, I ran some scans of our code base at work and found plenty of examples (mostly third-party cmodules vs python equivalents and a few that searched for similar functionality in different packages). It might be helpful if others were to also search their own code bases and post their findings: find . -name "*py" | xargs grep -C2 ImportError *py
Most of my company's examples fall into cases like this:
try: klass = load_class(foo) except ImportError: klass = NullClass
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.
- Previous message: [Python-Dev] Syntax suggestion for imports
- Next message: [Python-Dev] Return type of round, floor, and ceil in 2.6
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]