[openstack-dev] [all] Using \ for multiline statements
openstack at sheep.art.pl
Fri Dec 23 14:00:02 UTC 2016
There is a problem with the use of backslash at the end of the line, where
if you also put a space after it, it no longer does what it seemingly
should. Together with the fact, that you can achieve the same thing using
() in pretty much all instances (it used to not be true for imports, but
that has been fixed), it suggests that it should be avoided. However, it
does help to format certain Java-esque constructs (mostly with mox) in a
more readable way, so sometimes it's justified.
On Fri, Dec 23, 2016 at 12:28 AM, Sean McGinnis <sean.mcginnis at gmx.com>
> Looking for input from everyone, particularly those with more in-depth
> Python knowledge.
> In Cinder for some time we have been trying to enforce using () or
> reformatting code to avoid using \ to have statements span multiple
> lines. I'm not sure when this actually started, but I think it may
> be one of those things where someone got a review disagreement, so
> then that person started downvoting on it, then the next person, etc.
> I've seen some allusions to the use of \ having some issues, but I
> can't find any concrete examples where this can cause problems. I do
> seem to remember trying to write a hacking check or a code parsing
> tool to do something that choked on these, but it's long enough ago
> that I don't remember the details, and I could very well be mixing
> that up with something else.
> So my question is - is there a technical reason for enforcing this
> rule, or is this just a bad downvote that's gotten out of control?
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev