[openstack-dev] [all] Thoughts on python-future?

Eric Kao ekcs.openstack at gmail.com
Wed Nov 25 21:08:53 UTC 2015


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" <robertc at robertcollins.net> 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 <ekcs.openstack at gmail.com> 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-request at lists.openstack.org?subject:unsubscribe
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>
>
>
>
>-- 
>Robert Collins <rbtcollins at hp.com>
>Distinguished Technologist
>HP Converged Cloud
>
>__________________________________________________________________________
>OpenStack Development Mailing List (not for usage questions)
>Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev





More information about the OpenStack-dev mailing list