Chris Jerdonek <chris.jerdo...@gmail.com> added the comment:

> This isn't an easy one to fix - you basically need something along the lines 
> of a PEP 406 style import engine API in order to do the import without having 
> potentially adverse effects on the state in the sys module.

By adverse, do you just mean side effects? If so, since the documentation 
doesn't explicitly say so, is there any reason for the user to think there 
shouldn't be side effects?  For example, I tried this in Python 2.7:

>>> import os, sys, pkgutil, unittest
>>> len(sys.modules)
86
>>> g = pkgutil.walk_packages([os.path.dirname(unittest.__file__)])
>>> len(sys.modules)
86
>>> for i in g:
...   pass
... 
>>> len(sys.modules)
95

Or maybe this isn't what you mean. If not, can you provide an example?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14787>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to