On 07/29/2019 12:24 PM, Dominik Vilsmeier wrote:
I think the focus shouldn't be on whether such syntax is possibly confusing or not because
a) People will always remember that's either one way or the other
No, they won't.
b) It's actually pretty easy to remember which way it is, by just considering that a syntax feature exists for scenarios that can't be easily solved otherwise.
They also exist for scenarios that are easily resolved, but also easily gotten wrong:
x += 1
x = x + 1
I can easily see
for this in some_iter: ... except ValueError(): ..
as being syntactic sugar for
for this in some_iter: try: ... except ValueError(): ...
as it can easily save several levels of indenting.