[Python-3000] [stdlib-sig] PEP 3108 - stdlib reorg/cleanup
Jim Jewett
jimjjewett at gmail.com
Tue Apr 29 22:57:45 CEST 2008
On 4/29/08, Brett Cannon <brett at python.org> wrote:
> On Tue, Apr 29, 2008 at 5:07 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> > Raymond Hettinger wrote:
> > > > For modules that are renamed, stub modules will be created with the
> > > > original names ...
> > > What is the purpose of the new directory? Are there some use
> > > cases for intermixing the new and old names? Is there something
> > > that the 2-to-3 converter won't be able to handle?
People can start using the new "proper" names immediately.
People can reduce the number of changes for which they rely on 2-to-3.
> > I'd like to see the PEP address the question of how it is going to deal
> > with getting duplicate copies of modules in sys.modules when some code in an
> > application uses the old name and some code uses the new name.
> There is not much that can be done without introducing a custom
> importer to handle the mapping of names in sys.modules to the same
> module object. Otherwise it's going to be done using ``from _ import
> *``.
The following worked on python 2.5
zort.py
---------
import sys
import collections
sys.modules[__name__]=collections
>>> import zort
>>> zort is collections
True
More information about the Python-3000
mailing list