[Python-Dev] Add more SyntaxWarnings?

Stephen J. Turnbull turnbull.stephen.fw at u.tsukuba.ac.jp
Thu Jan 24 23:06:26 EST 2019


Chris Barker - NOAA Federal via Python-Dev writes:

 > Well, yes, that particular example is pretty clear. But as a rule,
 > there are a LOT of errors that can be pretty mysterious to newbies.

Isn't that the very definition of "newbie"?  That's half a joke, but I
really don't think that programmers new to Python should be the
standard.  The problematic cases are those where even a relatively
experienced Python programmer needs to be told why an error is raised,
because it's too hard to figure out from background knowledge of the
language, you need to know about implementation internals.

 > I would love to see Python become generally more informative with
 > errors.

I would love to see all automated systems become more informative with
errors!  One thing I like about Python the development community is
that people are doing something about it.  Slowly but surely ....

 > I don’t think so — what we need are helpful error messages. If it
 > will be raised at compile time, then it won’t generally be
 > catchable in s try-except— so the actual exception type isn’t very
 > important.

+1

In general depending much on exception type is a hit-or-miss affair.


More information about the Python-Dev mailing list