> LOOK similar, but are subtly different. The current 'with' statement > doesn't create a subscope; the only "context" it creates is regarding > the resource represented by the context manager. For instance, opening > a file in a 'with' block will close the file at the end of the block - > but you still have a (closed) file object. Using "with... as" for name > bindings wouldn't call __enter__ or __exit__, so it won't create that > kind of context; and whether it creates a subscope for the variable or > not, it's not going to match the 'with' statement. >
That is all valid, but it still would be familiar, and easier to explain. Python already uses "in", which is used in other languages to introduce context. The statement structure of "with...as" seems desirable, just asking for a word that is not "with" or "given". I don't remember if "when" was already rejected. http://www.thesaurus.com/browse/with?s=t http://www.thesaurus.com/browse/given?s=t http://www.thesaurus.com/browse/considering?s=t http://www.thesaurus.com/browse/assume?s=t http://www.thesaurus.com/browse/when?s=t Cheers! -- Juancarlo *Añez*
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/