[Python-ideas] Allow parentheses to be used with "with" block

Chris Angelico rosuav at gmail.com
Tue Feb 17 05:03:55 CET 2015


On Tue, Feb 17, 2015 at 2:50 PM, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> Chris Angelico writes:
>
>  > But since there aren't many unary/binary collisions anyway
>  > - the only ones I can think of are "+" and "-"
>
> "*" and "**" (the latter may require PEP 422?)

Ah, I don't really think of those as operators, but I guess they are.
(Fortunately, they are again prefix operators, so it's unambiguous.)
Outside of PEP 422, both of these, in their unary forms, must be
inside parentheses, right? So it's impossible to "trail" them in this
way?

In theory, it'd be possible to break after a unary plus or minus:

value = 5 + -
    3

ChrisA


More information about the Python-ideas mailing list