osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] Add more SyntaxWarnings?


>. There's nothing mysterious about e.g. `TypeError: unsupported operand
type(s) for +: 'int' and 'str'`, unlike the case of the two concatenated
tuples. (Surely people get errors about int+str all the time, and they've
never complained -- unlike the tuple tuple case.)

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.

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

In this case, you?d probably get a similar error, but it?s still nice to
get it sooner, and if the hooks are in place, We could have others that are
really helpful.

-CHB


Is there value in distinguishing
> "InevitableTypeError" from "InevitableAttributeError"?
>

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.

-CHB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190124/f7b9f0b7/attachment-0001.html>