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

Dan Smith dms at danplanet.com
Thu Nov 14 00:59:14 UTC 2013


> I'd like us to avoid meaningless reviewer churn here:

I'd like us to avoid trivial style guideline churn :)

> The case that made me raise this is this:
>     folder_exists, file_exists, file_size_in_kb, disk_extents = \
>         self._path_file_exists(ds_browser, folder_path, file_name)
> 
> Wrapping that in brackets gets this;
>     folder_exists, file_exists, file_size_in_kb, disk_extents = (
>         self._path_file_exists(ds_browser, folder_path, file_name))
> 
> Which is IMO harder to read - double brackets, but no function call,
> and no tuple: it's more ambiguous than \.

I prefer consistency for readability over most everything. In Nova, we
have a few cases of backslash continuations, which I think are mostly in
old db_api code, but I think it's overwhelmingly paren-based
continuations. I'd much rather keep things the way they are except for
situations where there is a real problem. I think that when modifying
existing backslash-using code, nobody argues, and I think that if an
author were to make a reasonable readability argument in a specific
case, that reviewers would allow the backslash method.

--Dan




More information about the OpenStack-dev mailing list