> Even if it weren't a syntax error, the syntax would be ambiguous. How
> will you discern the meaning of::
>
>     with (
>             foo,
>             bar,
>             baz):
>         pass
>
> Is that three separate context managers? Or is it one tuple with three
> items?

Is it meaningful to use "with" with a tuple, though? Because a tuple
isn't a context manager with __enter__ and __exit__ methods. For
example:

>>> with (1,2,3): pass
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: __exit__

So -- although I'm not arguing for it here -- you'd be turning an code
(a runtime AttributeError) into valid syntax.

-Ben
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to