Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #196250

Re: Suggested python feature: allowing except in context maneger

From Cameron Simpson <cs@cskk.id.au>
Newsgroups comp.lang.python
Subject Re: Suggested python feature: allowing except in context maneger
Date 2024-06-14 08:49 +1000
Message-ID <mailman.134.1718319303.2909.python-list@python.org> (permalink)
References <26219.12286.674908.902341@ixdm.fritz.box> <Zmt3jGdsxN7eMZyQ@cskk.homeip.net>

Show all headers | View raw


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>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Suggested python feature: allowing except in context maneger Cameron Simpson <cs@cskk.id.au> - 2024-06-14 08:49 +1000

csiph-web