[openstack-dev] [style] () vs \ continuations

Zhongyue Luo zhongyue.nah at intel.com
Thu Nov 14 06:57:29 UTC 2013


On Thu, Nov 14, 2013 at 2:34 PM, Chris Behrens <cbehrens at codestud.com>wrote:

>
> On Nov 13, 2013, at 6:55 PM, Robert Collins <robertc at robertcollins.net>
> wrote:
>
> > On 14 November 2013 15:28, Chris Behrens <cbehrens at codestud.com> wrote:
> >> For this example, I'd look at using parens on the left side to see if
> that helps.  I also, like Sean, really dislike the look of \.
> >
> > I dislike \ most of the time too :).
> >
>
> :)
>
> >
> >>>> (foo, bar, baz =
> >  File "<stdin>", line 1
> >    (foo, bar, baz =
> >                   ^
> > SyntaxError: invalid syntax
>
> Right.  I was thinking something like this:
>
> (folder_exists, file_exists,
>  file_size_in_kb, disk_extents) = self._path_file_exists(ds_browser,
>
>              folder_path,
>
>              file_name)
>
>
I've split the line in situations like this in the past to remove
backslashes in Nova.

foo = self._path_file_exists(ds_browser, folder_path, file_name)
folder_exists, file_exists, file_size_in_kb, disk_extents = foo

There should always be a way to avoid backslashes.


> Or something similar.
>
> - Chris
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



-- 
*Intel SSG/STO/DCST/CIT*
880 Zixing Road, Zizhu Science Park, Minhang District, 200241, Shanghai,
China
+862161166500
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20131114/1d911b45/attachment.html>


More information about the OpenStack-dev mailing list