Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> "except:" is explicit enough and "except BaseException" is redundant.

Take that up with the consensus view of the python community, as reflected by python linters in their default configuration, almost all of which warn on bare except.

The debate in the PEP is whether this should be a syntax error. The debate about whether it is good style is over though.

> It's also not worth breaking production code over this.

Agreed.



> Take that up with the consensus view of the python community, as reflected by python linters in their default configuration, almost all of which warn on bare except.

I don't fully agree on it being a purely a style issue (though the warnings from linters are wholly justified). From what I understand, "except:" is a code smell because you don't actually want to catch BaseException instead of just Exception.

Linters wouldn't have warned about it if it meant "except Exception:". The real issue, IMO, is the fact non-exceptions (Ctrl-C, generator exit, program exit code, etc.) have been crammed into the exception system.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: