renaming imports

9 views
Skip to first unread message

Tarek Ziadé

unread,
Jun 25, 2011, 3:22:40 PM6/25/11
to The fellowship of the packaging
Hey

FYI

In order to facilitate the 3to2 conversion, I am planning to rename
all imports to something like:

import packaging as _packaging

So it's easy to automatically rename it to :

import distutils2 as _packaging


Cheers
Tarek

--
Tarek Ziadé | http://ziade.org

Lennart Regebro

unread,
Jun 25, 2011, 4:16:49 PM6/25/11
to the-fellowship-...@googlegroups.com
On Sat, Jun 25, 2011 at 21:22, Tarek Ziadé <ziade...@gmail.com> wrote:
> Hey
>
> FYI
>
> In order to facilitate the 3to2 conversion, I am planning to rename
> all imports to something like:
>
>  import packaging as _packaging
>
> So it's easy to automatically rename it to :
>
>  import  distutils2 as _packaging

I never understood why that renaming is needed.
Can't it be called packaging under Python 2 as well?

//Lennart

Michael Foord

unread,
Jun 25, 2011, 4:23:27 PM6/25/11
to the-fellowship-...@googlegroups.com
The external port should have a different name to the standard library module. This is so that, for example, when Python 3.4 comes out with new features in "packaging" you can use the external port with Python 3.3 without the name clashing with the standard library package.

This is working very well for unittest2, where many features are available in Python 2.7, yet Python 2.7 users will still be able to use the features new in Python 3.2  by importing unittest2. 

Michael
 

//Lennart



--
http://www.voidspace.org.uk/

May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html

Lennart Regebro

unread,
Jun 25, 2011, 4:35:49 PM6/25/11
to the-fellowship-...@googlegroups.com
OK.
Reply all
Reply to author
Forward
0 new messages