[Python-3000] PEP 3108 - stdlib reorg/cleanup

Collin Winter collinw at gmail.com
Tue May 6 18:07:00 CEST 2008


On Thu, May 1, 2008 at 11:02 AM, Brett Cannon <brett at python.org> wrote:
> On Thu, May 1, 2008 at 7:41 AM, Collin Winter <collinw at gmail.com> wrote:
>  >
>  > On Mon, Apr 28, 2008 at 7:30 PM, Brett Cannon <brett at python.org> wrote:
>
>
> >  >  Transition Plan
>  >  >  ===============
>  >  >
>  >  >  For modules to be removed
>  >  >  -------------------------
>  >  >
>  >  >  For the removal of modules that are continuing to exist in the Python
>  >  >  2.x series (i.e., not deprecated explicitly in the 2.x series),
>  >  >  ``warnings.warn3k()`` will be used to issue a DeprecationWarning.
>  >
>  >  FYI, we can also flag these using 2to3.
>  >
>
>  I can't remember if we have a guiding rule on this yet, but if 2to3
>  can fix this, do we still want the warning? Obviously both names will
>  be provided so people can move their code over, but perhaps the
>  warning is not needed?

I say keep the runtime warning. 2to3 can't fix the cases where the
module is being removed entirely; the best it can do is to flag the
import statement as requiring the user's attention.

>  >  >  Renaming of modules
>  >  >  -------------------
>  >  >
>  >  >  For modules that are renamed, stub modules will be created with the
>  >  >  original names and be kept in a directory within the stdlib (e.g. like
>  >  >  how lib-old was once used).  The need to keep the stub modules within
>  >  >  a directory is to prevent naming conflicts with case-insensitive
>  >  >  filesystems in those cases where nothing but the case of the module
>  >  >  is changing.
>  >  >
>  >  >  These stub modules will import the module code based on the new
>  >  >  naming.  The same type of warning being raised by modules being
>  >  >  removed will be raised in the stub modules.
>  >  >
>  >  >  Support in the 2to3 refactoring tool for renames will also be used
>  >  >  [#2to3]_.  Import statements will be rewritten so that only the import
>  >  >  statement and none of the rest of the code needs to be touched.  This
>  >  >  will be accomplished by using the ``as`` keyword in import statements
>  >  >  to bind in the module namespace to the old name while importing based
>  >  >  on the new name.
>  >
>  >  You should cite the existing fix_imports fixer as one example of how
>  >  to do this: http://svn.python.org/view/sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py?view=markup
>
>  Done.
>
>  -Brett
>


More information about the Python-3000 mailing list