[Python-ideas] Check type hints in stack trace printing

Ivan Levkivskyi levkivskyi at gmail.com
Sun Jun 17 19:50:40 EDT 2018


On 14 June 2018 at 12:03, Daniel Sánchez Fábregas <
daniel.sanchez.fabregas at xunta.gal> wrote:

> My idea consist in:
> Adding a method to perform type checking in traceback objects
> When printing stack traces search for mistyped arguments and warn about
> them to the user.
>
> Don't know if it is in the roadmap, but seems that have a good
> cost/benefit ratio to me.
>

It seems to me too this will be rather a work for a static type checker
like mypy.
There is a misconception that runtime objects can be attributed (or checked
w.r.t.) static types,
but this is true only in simple cases.

Also such runtime check will be not able to correctly catch many type
errors that can be
detected statically, like a wrong assignment or a Liskov violation.

--
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180618/1b590c81/attachment.html>


More information about the Python-ideas mailing list