Re: Suggested python feature: allowing except in context maneger

Liste des GroupesRevenir à cl python 
Sujet : Re: Suggested python feature: allowing except in context maneger
De : cs (at) *nospam* cskk.id.au (Cameron Simpson)
Groupes : comp.lang.python
Date : 13. Jun 2024, 23:49:48
Autres entêtes
Message-ID : <mailman.134.1718319303.2909.python-list@python.org>
References : 1 2
User-Agent : Mutt/2.2.13 (2024-03-09)
On 13Jun2024 19:44, dieter.maurer@online.de <dieter.maurer@online.de> wrote:
Why not use:
```
try:
 with open()...
   ...
except FileNotFoundError:
 ...
```
This is exactly what the OP was expressing dissatisfaction with.
I'm -1 on the idea myself - not every combination of things needs additional syntactic support, and doing stuff like merging an `except` with a `wtih` is bound to introduce some weird corner case, complicating its semantics.
Cheers,
Cameron Simpson <cs@cskk.id.au>

Date Sujet#  Auteur
14 Jun 24 o Re: Suggested python feature: allowing except in context maneger1Cameron Simpson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal