[Python-ideas] Python-ideas Digest, Vol 93, Issue 31

Christian Heimes christian at python.org
Thu Aug 14 13:38:45 CEST 2014


On 14.08.2014 12:27, Juancarlo Añez wrote:
> The problem with declaring raisable exceptions is that it invites
> static verification of callers doing "the right thing" with them,
> as in Java, and that introduces noise in the software development
> process that is almost impossible to clean up.
[snip]
> The right thing to do with an exception is to let it through,
> unless you know exactly what you have to do about it.
> 
> In this interview, Anders Hejlsberg talks about why checked
> exceptions were left out of the design of C#:

Thanks for your input, Juancarlo.

I don't think that anybody wants to add checked exceptions to Python
at this point. It's one of my pain points with Java, too. As far as I
can judge Raymond we both want to archive the same goal: improve
introspection and self-documentation of code with a strong focus on
bindings (e.g. C code).

As I tried to explain earlier neither users nor tools are able to
analyze code like builtin types and functions. Exception annotations
could help IDEs to figure out what kind of exception could be raised.
Does it sound better to you?

The general idea is remotely related to mypy and should be addressed
by a different PEP that accompanies the mypy PEP.

Regards,
Christian



More information about the Python-ideas mailing list