Re: [Python-Dev] Multiline with statement line continuation

2014年8月16日 05:52:12 -0700

Steven D'Aprano <[email protected]>:
> I simply don't care. They will try it, discover that tuples are not 
> context managers, fix their code, and move on.
*Could* tuples (and lists and sequences) be context managers?
*Should* tuples (and lists and sequences) be context managers?
> I don't think that some vague similarity between it and tuples is
> justification for rejecting the proposal.
You might be able to have it bothways. You could have:
 with (open(name) for name in os.listdir("config")) as files:
 ...
Marko
_______________________________________________
Python-Dev mailing list
[email protected]
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