On Fri, Dec 27, 2002 at 11:59:48PM +0100, Just van Rossum wrote: > > The sys.meta_path feature adds 32 lines to import.c, it's *really* > useful and easy to use. I would be *extremely* sad to see it go. > > (I had an immediate use for it in test_importhooks.py: after a test is > run I wanted to unload the modules that were imported during the test. > The ImportTracker is a meta importer and only *records* imports. It's > seven lines long and helped me clean up the test script quite a bit. Not > a typical use case perhaps, but to me still demonstrates the power of > meta_path quite well. Doing the same with __import__ is of course > possible, but is much more cumbersome and doesn't have the same > semantics.) Just my 1.5c - PyUnit has a similar use case. It is documented (well) at http://pyunit.sourceforge.net/notes/reloading.html []s, |alo +---- -- Those who trade freedom for security lose both and deserve neither. -- http://www.laranja.org/ mailto:lalo@laranja.org pgp key: http://www.laranja.org/pessoal/pgp Eu jogo RPG! (I play RPG) http://www.eujogorpg.com.br/ GNU: never give up freedom http://www.gnu.org/
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