[openstack-dev] [nova] contextlib.nested and Python3 failing

Sylvain Bauza sbauza at redhat.com
Mon Aug 24 13:30:55 UTC 2015



Le 23/08/2015 02:01, Feodor Tersin a écrit :
> > From: kevin.mitchell at rackspace.com
> >
> > Actually, there should no longer be a need to use contextlib.nested.
> > We've explicitly dropped Python 2.6 compatibility, which means we're
> > expecting compatibility with Python 2.7+ only, and as of Python 2.7, the
> > 'with' statement supports accepting multiple 'as' clauses. The
> > contextlib.nested tool was really only necessary to work around that
> > functionality being missing in Python 2.6, and has been deprecated as of
> > Python 2.7 because it's no longer necessary.
>
> 'with' statement has multiple form, but it does not allow line breaks 
> inside. It leads to ugly formatting.
> See 
> https://github.com/stackforge/ec2-api/commit/f5b320edbbc8ab554dae496dcae78be6fdd25fe7#diff-bfcbc316f2eb6b39de99a921a5753aadL631
>
>

Yeah, even if the 'with' statement accepts now more than just one 
clause, it doesn't accept to have it in multiple lines using the () for 
leaving less than 80 chars for each line.

-Sylvain

>
> __________________________________________________________________________
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150824/835e669a/attachment.html>


More information about the OpenStack-dev mailing list