← Back to DAGDA | Support | Source: https://mail.python.org/pipermail/python-porting/2015-June/000486.html

[Python-porting] python-future and six

Clay Gerrard clay.gerrard at gmail.com
Thu Jun 11 01:33:30 CEST 2015


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-porting/attachments/20150610/327daeca/attachment.html>


More information about the Python-porting mailing list