3 ms·
Interesting. The way I was taught Python, you really, really don't want to use bare `except:`, because it catches _everything_: Ctrl-C interruptions, system ex
by joshkel 2y ago
Interesting.
The way I was taught Python, you really, really don't want to use bare `except:`, because it catches _everything_: Ctrl-C interruptions, system exit, etc. Instead, you really ought to use `except Exception:` (where `Exception` is the base class for any "normal" runtime error).
So I definitely understand the rationale, but it's hard to say it's worth the pain of backward incompatibility - we have linters, style guides, etc. that can catch this.
- wild_pointer 2y agoYes, I was bitten by it in the past. Still, it'd better be a lint, or at least a very very long deprecation period... like, deprecated and removed in Python 4 or something.
- shadowgovt 2y agoHaving your linter catch `except:` is both simpler and cleaner than changing the language.
- dtech 2y agoDeprecating without removing ever seems reasonable
- shadowgovt 2y agoHow does deprecation without removal differ from a best practice? All features of a language end up used, regardless of deprecation state.
- dtech 2y agoI steers people who don't know better away in numerous ways, e.g. most editors with language awareness will give some kind of visual indication like a strike-trough.
- dimator 2y agoabsolutely, this should not be done at the language level. the language should not enforce "best practices", that's what the ecosystem is for.