News for hackers. Stuff that matters.
Re:Why Today's Python Developers Are Embracing Type Hints by sevensor on Sunday September 28, 2025 @10:25AM (#45404557)
One of the things that makes typing an existing codebase difficult in Python is dealing with variance issues. It turns out people get these wrong all over the place in Python and their code ends up working by accident.

Generally it’s not worth trying to fix this stuff. The type signature is hell to write and ends up being super complex if you get it to work at all. Write a cast or Any, document why it’s probably ok in a comment, and move on with your life. Pick your battles.

There are no comments on this comment yet.