Re: [Python-Dev] PEP 340: syntax suggestion - try opening(filename) as f:

2005-04-29 Thread Phillip J. Eby
At 08:21 PM 4/29/05 -0500, Ka-Ping Yee wrote: All the statements in Python are associated with keywords, except for assignment, which is simple and extremely common. I don't think the block statement is simple enough or common enough for that; its semantics are much too significant to be flagged o

Re: [Python-Dev] PEP 340: syntax suggestion - try opening(filename) as f:

2005-04-29 Thread Ka-Ping Yee
On Fri, 29 Apr 2005, Guido van Rossum wrote: > The more I think about it the more I like having no keyword at all > (see other messages). I hope you'll reconsider this. I really think introducing a new statement requires a keyword, for pedagogical reasons as well as readability and consistency.

Re: [Python-Dev] PEP 340: syntax suggestion - try opening(filename) as f:

2005-04-29 Thread Guido van Rossum
[Michael Spencer] > I don't know whether it's true for all the PEP 340 use cases, but the all the > current examples would read very naturally if the block-template could be > specified in an extended try statement: Sorry, this emphasizes the wrong thing. A try-statement emphasizes that the body m

[Python-Dev] PEP 340: syntax suggestion - try opening(filename) as f:

2005-04-29 Thread Jim Jewett
Michael Spencer: > I don't know whether it's true for all the PEP 340 use cases, but the all the > current examples would read very naturally if the block-template could be > specified in an extended try statement: >> 1. A template for ensuring that a lock, acquired at the start of a >>

[Python-Dev] PEP 340: syntax suggestion - try opening(filename) as f:

2005-04-29 Thread Michael Spencer
I don't know whether it's true for all the PEP 340 use cases, but the all the current examples would read very naturally if the block-template could be specified in an extended try statement: 1. A template for ensuring that a lock, acquired at the start of a block, is released when th