Re: Language improvement: Get more from the `for .. else` clause

2016-06-29 Thread Victor Savu
interested in a more concrete case such as a domain-specific application (I can think of progress bars, logging, transfer rate statistics ...). Best, VS On Mon, Jun 27, 2016 at 5:06 PM, Michael Selik wrote: > On Mon, Jun 27, 2016 at 12:53 AM Victor Savu < > victor.nicolae.s...@gmail.c

Re: "for/while ... break(by any means) ... else" make sense?

2016-06-29 Thread Victor Savu
There are many posts trying to explain the else after for or while. Here is my take on it: There are three ways of getting out of a (for/while) loop: throw, break or the iterator gets exhausted. The question is, how cab we tell which way we exited? For the throw, we have the except clause. This le

Language improvement: Get more from the `for .. else` clause

2016-06-26 Thread Victor Savu
proof-of-concept implementation: repository: https://github.com/Victor-Savu/cpython branch: feat/else_capture Dear members of the Python list, I am writing to discuss and get the community's opinion on the following two ideas: 1. Capture the `StopIteration.value` in the `else` c