[stdlib-sig] Changing the 2.6 renames to not break pickle

Alexandre Vassalotti alexandre at peadrop.com
Mon May 19 23:23:26 CEST 2008


On Mon, May 19, 2008 at 3:21 PM, Brett Cannon <brett at python.org> wrote:
> Apparently pickle doesn't like the way renames have been handled in
> 2.6 and people don't want to mess with pickle, so that means the
> renames need to change.
>
> So, here is my idea (only need to care about modules that have stuff
> to pickle, e.g., don't need to change test.support):
>
> * Rename lib-old to lib-new
>
> * Change the names in lib-new to the new names.
>
> * Change the names in the stdlib to the old names.
>
> * Move the Py3K warnings out of the stubs in lib-new and put them in
> the modules directly stored in the stdlib.
>
> * Change the imports in the stubs in lib-new to import the old name
> and suppress the Py3K warning (probably use
> test.support.catch_warning() with a *very* specific ignore filter).
>
> I think that gets __module__ set to the old module name even when code
> is imported with the new name. It should also allow the Py3K warnings
> to stick around without causing issues when importing from the new
> name or suppressing other Py3K warnings. What do people think?
>

Sound fine to me. Although this is going to be mess, it seems to be
our only reasonable choice.

-- Alexandre


More information about the stdlib-sig mailing list