[Python] Typing and tkinter: A journey into darkness

Discussão em 'Python' iniciado por Stack, Agosto 21, 2025.

  1. Stack

    Stack Membro Participativo

    I'm working on a script with a tkinter front end (not for the faint-at-heart!), and as someone who is pretty committed to the concept of strict type checking, I'm finding it a bit challenging.

    tkinter is not typed, and as a result, about half the lines in my code have cascading type errors, so my code is filled with # type: ignore directives.

    I get that type hints in Python are a sort of bolt-on afterthought, and that tkinter is a wrapper around code that approaches types differently (if at all), but I expect that a core Python library should be a bit more type hint friendly.

    Is there a standard set of type stubs that can make tkinter a bit easier to work with?

    Continue reading...

Compartilhe esta Página