[openstack-dev] [nova] Port Nova to Python 3

Kevin L. Mitchell kevin.mitchell at rackspace.com
Fri Apr 24 20:20:06 UTC 2015


On Fri, 2015-04-24 at 16:07 -0400, Sean Toner wrote:
> What I meant by the worst of both worlds is that you don't get the nice 
> new features of python3, while simultaneously dealing with the headaches 
> of making code run under both python versions.  You'll have to do weird 
> things with imports (for example urllib) and deal with the 
> inconsistencies between some functions that return strings and some that 
> return unicode, and some that return bytes.
> 
> It's not impossible, but you have to add that extra work while also 
> depriving yourself of the goodness of python3 only features :)

This is why the 'six' library is such a godsend; this stuff is still not
easy, but the hardest parts, like the imports problem, are already taken
care of by six…and maintaining the bytes/strings/unicode distinction is
actually just as useful in Python 2, it just doesn't have the machinery
to really detect the mixing :)
-- 
Kevin L. Mitchell <kevin.mitchell at rackspace.com>
Rackspace




More information about the OpenStack-dev mailing list