On Jul 29, 2019, at 12:24, Dominik Vilsmeier <dominik.vilsme...@gmx.de> wrote:
> 
> I could imagine that due to the awkward workaround, especially regarding 
> `with`, corresponding "self-made" code is either error-prone or people will 
> not even try to work around it in the first place. This feature will probably 
> be among the less prominent ones, but someone who needs it will be glad that 
> it exists and they're also likely to be well aware of what it does (just like 
> with `for ... else`).

I think it’s a problem if this feature is accepted at a level more or less akin 
for for…else.

The problem that  for…else solves is a bit clunkier to solve without it, but 
not that bad—novices can and do figure out how to write correct code without 
else. So, while it’s a shame so many people never learn to use it, it’s not a 
huge deal.

The problem that with…except solves is so much harder to solve without it that 
even experienced developers usually just punt and try…except the whole block 
around the with. That’s a lot worse. And this isn’t a rare thing; it comes up 
all the time in all kinds of code. So it really calls for a syntax that most 
people will learn to use, not something like for…else that some experts use but 
most people live without.

(But I don’t have a better syntax to offer. I actually like with…except, if it 
were just for my use, but on reflection I can see why others find it confusing. 
Just like for…else.)





_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/5PQFD5ORL7K45IZT55ATKU3SRJ7NFV2G/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to