Skip to content

Comment on The Ultimate Guide to Error Handling in Pythonparent

Comments

Ah, I understand now. Well, by default Python doesn't declare a return type either yet the tools are able to infer it in many cases; I see no reason why tools like mypy couldn't similarly infer the raised exception types as well.

Plus, the typing annotations could presumably be expanded to include some notification to declare raised exception types explicitly.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.