Need for Advanced Typing Tutorials

I find there are very few good resources online for understanding difficult typing concepts. While the mypy docs and typeshed readthedocs are a great start, I find myself in need of much more advanced tutorials.

Specifically, I work with many older 3rd party libraries (some of which are C-ports), and it is very painful trying to successfully type hint those.

I would love to see YouTube videos and/or a book on the subject. I’m also able to go through the typeshed repo and study the library of types that already exist, but perhaps my biggest pain point is using the @overload decorator and making subclasses of 3rd party libraries Liskov compliant.

Does anyone else have the same struggles?

Please let me know and if there’s something that can be done to create a (truly) advanced typing tutorial for Python.

Justin Ellis has a blog post about advanced typing concepts in Python here:

I reached out to him and he would be willing to contribute this as Python documentation. Is that something the Python community would be interested in? Perhaps in the HOWTOs section of the docs?

I’ve been on and off making a bunch of improvements to the mypy documentation recently. If you have suggestions for things you want to see improved docs, please post on Documentation updates · Issue #13681 · python/mypy · GitHub and I’ll try to incorporate them.

Thanks for mentioning the point about overloads. My biggest complaint is that it’s often unclear to users how best to use overloads with Literal types + some cases where you need keyword-only args when omitting arguments. Curious if that’s what you’re referring to, or you have something else in mind. Could you speak more about what difficulties you face with Liskov? Feel free to reply on the issue too!

1 Like