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


Groups > comp.lang.python > #196250 > unrolled thread

Re: Suggested python feature: allowing except in context maneger

Started byCameron Simpson <cs@cskk.id.au>
First post2024-06-14 08:49 +1000
Last post2024-06-14 08:49 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#196250 — Re: Suggested python feature: allowing except in context maneger

FromCameron Simpson <cs@cskk.id.au>
Date2024-06-14 08:49 +1000
SubjectRe: Suggested python feature: allowing except in context maneger
Message-ID<mailman.134.1718319303.2909.python-list@python.org>
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>

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web