[Python-ideas] with-statement syntactic quirk
barry at python.org
Wed Oct 31 17:51:53 CET 2012
On Oct 31, 2012, at 09:55 PM, Nick Coghlan wrote:
>It's not an especially subtle corner of the grammar, it's
>tuples-as-context-managers (i.e. the case with no as clauses) that
> with (cmA, cmB):
>This is: a) useless (because tuples aren't context managers); but also
>b) legal syntax (it blows up at runtime, complaining about a missing
>__enter__ or __exit__ method rather than throwing SyntaxError at
So clearly we need to make tuples proper context managers <wink>.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: not available
More information about the Python-ideas