Re: [openstack-dev] [all] Thoughts on python-future?
Hi, I'm porting OpenStack code to Python 3 for two years. I'm happy with six. It has been adopted by all OpenStack projects which are being ported to (or have been ported to) Python 3. It was discussed to use python-future in Swift, but Swift is now using six too. I wrote a tool to port an OpenStack project to six: https://pypi.python.org/pypi/sixer It does at least half of the port for you. I wrote the tool to be able to produce patches reviewable by a human: you can easily select which operations are enabled or not to produce smaller patches, and you can rerun the tool multiple times. FYI I wrote an article to explain why I wrote a new tool for OpenStack: https://haypo.github.io/python3-sixer.html Victor Le 25/11/2015 03:33, Eric Kao a écrit : Hi all, I’ve been using the python-future library for Python 3 porting and want to see what people think of it. http://python-future.org/overview.html#features The end result is standard Python3 code made compatible with Python2 through library imports. The great thing is that Python 3 execution is mostly independent of the library, so once Python 2 support is dropped, the use of the library can be dropped too. Anyone know why it’s not used in OpenStack perhaps alongside six? Thanks! __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all] Thoughts on python-future?
All informations on Python 3 are on the wiki: https://wiki.openstack.org/wiki/Python3 You may also join the IRC channel on Freenode: #openstack-python3 Victor Le 25/11/2015 03:33, Eric Kao a écrit : Hi all, I’ve been using the python-future library for Python 3 porting and want to see what people think of it. http://python-future.org/overview.html#features The end result is standard Python3 code made compatible with Python2 through library imports. The great thing is that Python 3 execution is mostly independent of the library, so once Python 2 support is dropped, the use of the library can be dropped too. Anyone know why it’s not used in OpenStack perhaps alongside six? Thanks! __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all] Thoughts on python-future?
I think the main benefit of python-future is that the library helps us write straight Python 3 code instead of special bridged code. For example, instead of writing six.iteritems(dict0), one could write simply dict0.items() and expect Python 3 behavior across Python 2 & 3. This way, whenever Python 2 support is dropped, we can easily drop the dependence on the library just by dropping the import statements, because the library mostly had no effect in Python 3 in the first place. But as others have pointed out, the downside is that the library mucks with the Python 2 internals, apparently causing much grief =( On 11/24/15, 7:05 PM, "Robert Collins"wrote: >Which bit in particular do you like? Some of the stuff - like >past.translation - is likely to be deeply fragile, other bits are >fine, but not really any different to six. > >On 25 November 2015 at 15:33, Eric Kao wrote: >> Hi all, >> >> I¹ve been using the python-future library for Python 3 porting and want >>to >> see what people think of it. >>http://python-future.org/overview.html#features >> >> The end result is standard Python3 code made compatible with Python2 >>through >> library imports. The great thing is that Python 3 execution is mostly >> independent of the library, so once Python 2 support is dropped, the >>use of >> the library can be dropped too. >> >> Anyone know why it¹s not used in OpenStack perhaps alongside six? >>Thanks! >> >> >>_ >>_ >> OpenStack Development Mailing List (not for usage questions) >> Unsubscribe: >>openstack-dev-requ...@lists.openstack.org?subject:unsubscribe >> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev >> > > > >-- >Robert Collins >Distinguished Technologist >HP Converged Cloud > >__ >OpenStack Development Mailing List (not for usage questions) >Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe >http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all] Thoughts on python-future?
Thanks for sharing your thoughts and experiences everyone! It’s really too bad that the library causes all this headache. The goal is laudable: enable Python 3 code to run on Python 2 with minimal modification. It’d be really nice to write clean, standard Python 3 code [e.g., dict0.items() ] rather than special, bridged code [e.g., six.iteritems(dict0) ] for Python 2+3 compatibility. Such is life I guess. The goal inevitably requires messing with Python 2 internals to conform to Python 3 behavior, which inevitably leads to the issues people mentioned. Thanks again! On 11/25/15, 10:10 AM, "Joshua Harlow"wrote: >Julien Danjou wrote: >> On Tue, Nov 24 2015, Eric Kao wrote: >> >>> I¹ve been using the python-future library for Python 3 porting and >>>want to >>> see what people think of it. >>>http://python-future.org/overview.html#features >>> >>> The end result is standard Python3 code made compatible with Python2 >>>through >>> library imports. The great thing is that Python 3 execution is mostly >>> independent of the library, so once Python 2 support is dropped, the >>>use of >>> the library can be dropped too. >>> >>> Anyone know why it¹s not used in OpenStack perhaps alongside six? >>>Thanks! >> >> python-future has been a dependency of pytimeparse¹ for a while and it >> has been a nightmare. IIRC, python-future blends into Python magically >> so it is somehow automatically imported each time you run Python. This >> had a tendency to break random other Python packages installed in the >> environment. > >Oh, please no then, magically messing with other python packages by >monkeying with the internals of python we already have enough of (cough >cough eventlet, cough cough parts of jsonutils in oslo.serialization >that injects itself into anyjson)... > >Just say no to more please ;) > >> >> In the end we just dropped it from pytimeparse and we're much happier. >> >> And we're very happy with six. :) >> >> ¹ It's used by Gnocchi. >> >> >> >>_ >>_ >> OpenStack Development Mailing List (not for usage questions) >> Unsubscribe: >>openstack-dev-requ...@lists.openstack.org?subject:unsubscribe >> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all] Thoughts on python-future?
On 26 November 2015 at 10:08, Eric Kaowrote: > I think the main benefit of python-future is that the library helps us > write straight Python 3 code instead of special bridged code. > > For example, instead of writing six.iteritems(dict0), one could write > simply dict0.items() and expect Python 3 behavior across Python 2 & 3. But - one shouldn't be writing six.iteritems(dict0) *anyway* except in really specific circumstances. We had a mega thread on that a few months back - tl;dr at our scale - even at our aspirational scale - it rarely if ever matters. Its that that makes me actually skeptical - the overheads of 2+3 single tree compat are really really low already, generally. -Rob -- Robert Collins Distinguished Technologist HP Converged Cloud __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all] Thoughts on python-future?
Julien Danjou wrote: On Tue, Nov 24 2015, Eric Kao wrote: I¹ve been using the python-future library for Python 3 porting and want to see what people think of it. http://python-future.org/overview.html#features The end result is standard Python3 code made compatible with Python2 through library imports. The great thing is that Python 3 execution is mostly independent of the library, so once Python 2 support is dropped, the use of the library can be dropped too. Anyone know why it¹s not used in OpenStack perhaps alongside six? Thanks! python-future has been a dependency of pytimeparse¹ for a while and it has been a nightmare. IIRC, python-future blends into Python magically so it is somehow automatically imported each time you run Python. This had a tendency to break random other Python packages installed in the environment. Oh, please no then, magically messing with other python packages by monkeying with the internals of python we already have enough of (cough cough eventlet, cough cough parts of jsonutils in oslo.serialization that injects itself into anyjson)... Just say no to more please ;) In the end we just dropped it from pytimeparse and we're much happier. And we're very happy with six. :) ¹ It's used by Gnocchi. __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all] Thoughts on python-future?
On 11/25/2015 03:33 AM, Eric Kao wrote: > Hi all, > > I’ve been using the python-future library for Python 3 porting and want > to see what people think of it. > http://python-future.org/overview.html#features > > The end result is standard Python3 code made compatible with Python2 > through library imports. The great thing is that Python 3 execution is > mostly independent of the library, so once Python 2 support is dropped, > the use of the library can be dropped too. > > Anyone know why it’s not used in OpenStack perhaps alongside six? Thanks! Hi, The package embedds many 3rd party libs, and it is a nightmare to keep working well in a distribution. It also has very common namespace squatting, like xmlrpc, http, and such. If you were to introduce this package again in the global-requirements, I would vote -1 and convince the others to not accept it, as I don't think it is maintainable at the distro level. So please don't attempt it! :) Cheers, Thomas Goirand (zigo) __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all] Thoughts on python-future?
On Tue, Nov 24 2015, Eric Kao wrote: > I¹ve been using the python-future library for Python 3 porting and want to > see what people think of it. http://python-future.org/overview.html#features > > The end result is standard Python3 code made compatible with Python2 through > library imports. The great thing is that Python 3 execution is mostly > independent of the library, so once Python 2 support is dropped, the use of > the library can be dropped too. > > Anyone know why it¹s not used in OpenStack perhaps alongside six? Thanks! python-future has been a dependency of pytimeparse¹ for a while and it has been a nightmare. IIRC, python-future blends into Python magically so it is somehow automatically imported each time you run Python. This had a tendency to break random other Python packages installed in the environment. In the end we just dropped it from pytimeparse and we're much happier. And we're very happy with six. :) ¹ It's used by Gnocchi. -- Julien Danjou -- Free Software hacker -- https://julien.danjou.info signature.asc Description: PGP signature __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
[openstack-dev] [all] Thoughts on python-future?
Hi all, I¹ve been using the python-future library for Python 3 porting and want to see what people think of it. http://python-future.org/overview.html#features The end result is standard Python3 code made compatible with Python2 through library imports. The great thing is that Python 3 execution is mostly independent of the library, so once Python 2 support is dropped, the use of the library can be dropped too. Anyone know why it¹s not used in OpenStack perhaps alongside six? Thanks! __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all] Thoughts on python-future?
Which bit in particular do you like? Some of the stuff - like past.translation - is likely to be deeply fragile, other bits are fine, but not really any different to six. On 25 November 2015 at 15:33, Eric Kaowrote: > Hi all, > > I’ve been using the python-future library for Python 3 porting and want to > see what people think of it. http://python-future.org/overview.html#features > > The end result is standard Python3 code made compatible with Python2 through > library imports. The great thing is that Python 3 execution is mostly > independent of the library, so once Python 2 support is dropped, the use of > the library can be dropped too. > > Anyone know why it’s not used in OpenStack perhaps alongside six? Thanks! > > __ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > -- Robert Collins Distinguished Technologist HP Converged Cloud __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev