advanced module/import/namespace idioms
- From: "chuck" <cmedcoff@xxxxxxxxx>
- Date: 31 Dec 2005 05:39:27 -0800
Every once in awhile I run across a python module that might have
statements like:
for c in sys.modules[module].__dict__.values():
or
import __builtin__
__builtin__.__dict__['_'] = lambda x: x
Snurf also does some strange import trickory (see
http://bdash.net.nz/svn/snurf/trunk/snurf/dataStore/).
While I'm sure none of this stuff is rocket science, but rather just
"namespace manipulation" there is very little explanation in the python
world that explains these techniques. I've googled around to try to
find articles/papers that explain such techniques but cannot find any.
Can anyone point out any refereces that discuss such
module/import/namespace idioms.
.
- Follow-Ups:
- Re: advanced module/import/namespace idioms
- From: Scott David Daniels
- Re: advanced module/import/namespace idioms
- Prev by Date: Re: python coding contest
- Next by Date: Re: predicting function calls?
- Previous by thread: Vector math library
- Next by thread: Re: advanced module/import/namespace idioms
- Index(es):