[Python-ideas] with statement syntax forces ugly line breaks?
g.brandl at gmx.net
Thu Sep 9 14:16:49 CEST 2010
Am 09.09.2010 09:55, schrieb Ben Finney:
> "Gregory P. Smith" <greg at krypto.org>
>> On Wed, Sep 8, 2010 at 10:00 AM, Nathan Schneider <nathan at cmu.edu> wrote:
>> > I have approached these cases by using the backslash line-continuation
>> > operator:
>> > with FakeContext("a") as a, \
>> > FakeContext("b") as b:
>> > pass
>> I'm in the "\ is evil" at all costs camp […]
> I agree, especially when we have a much neater continuation mechanism
> that could work just fine here::
> with (FakeContext("a") as a,
> FakeContext("b") as b):
No, it could not work just fine. You are basically banning tuples from the
context expression (remember that the "as" clause is optional).
You would argue that this is not a problem because tuples are not context
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.
More information about the Python-ideas