[Greg Ewing] > My current thought is that it should look like this: > > with_file(filename) as f: > do_something_with(f) > > The success of this hinges on how many use cases can > be arranged so that the word 'as' makes sense in that > position. [...] > This way, the syntax is just > > expr ['as' assignment_target] ':' suite > > and the expr is evaluated quite normally. Perhaps it could be even simpler: [assignment_target '=']* expr ':' suite This would just be an extension of the regular assignment statement. (More in a longer post I'm composing off-line while picking cherries off the thread.) -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4