[Python-porting] python-future and six

Lennart Regebro regebro at gmail.com
Thu Jun 11 04:48:46 CEST 2015


Getting rid of the six dependency with for 90% of it's use just be a
question of doing search and replace, replaceing the six style with a
Python 3 style, so I don't think it's a problem.

Sure, python-future will, at least in theory be less work to drop, but
in any case I don't see it as being a lot of work. And since it can be
done module by module it can simply be done as a low priority cleanup
task, and  could probably be handed over to people who want to
contribute but are new to the codebase, leaving less work for the core
devs. :-)

On Thu, Jun 11, 2015 at 1:33 AM, Clay Gerrard <clay.gerrard at gmail.com> wrote:
> OpenStack [1] has been using six to handle python 2/3 compatibility in a
> number of places and is making good progress!  With eventlet now running a
> python2/3 compatible code base (Segrey went with the just inline six
> approach [2]) things are really starting to move quickly!  Lots of patches
> coming up with stuff imported from six.moves and isinstance six.strings_type
> everywhere - not so much six.b and six.u though - as the OpenStack projects
> already targets >=2.7 or >=3.3 (maybe even >=3.4?).
>
> But, I'm finding myself wondering what we're going to do with all these
> references to six in our code base once we drop python 2.7 support?  Is it
> worth it [3]?
>
> Also I was looking at Brett Cannon's updates to the official porting guide
> [4] which now references *both* six and python-future [5]?  I sorta like the
> idea that python-future might let me write more or less idiomatic python3
> code* and it will just work on python2?
>
> * as idiomatic as writing python 1.6 code felt on python 2.3 anyway :)
>
> So I've got at least these many choices:
>
>  * modernize + roll your own compat layer for stdlib imports
>  * inline six
>  * depend on six
>  * depend on python-future
>
> OpenStack so far seems to have picked "depend on six" so it's probably
> easiest to stick with the momentum - unless the momentum is heading us
> towards a cliff?
>
> Is there any hope the experts on the state of the art could tell me the
> "one-- and preferably only one --obvious way to do it"?  :)
>
> -Clay
>
> 1. https://github.com/openstack
> 2.
> https://bitbucket.org/eventlet/eventlet/src/80e4f11d037aaca81f9e0baf636282fd1e65236c/eventlet/support/six.py?at=default
> 3. http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/
> 4.
> https://mail.python.org/pipermail/python-porting/2014-December/000477.html
> 5. http://python-future.org/overview.html
>
> _______________________________________________
> Python-porting mailing list
> Python-porting at python.org
> https://mail.python.org/mailman/listinfo/python-porting
>


More information about the Python-porting mailing list