News for hackers. Stuff that matters.
Re:Google Python Style Guide by Jensson on Saturday February 11, 2023 @05:48AM (#34751171)
I used type hints everywhere in python, they are orthogonal to what I talked about.
Re:Google Python Style Guide by kroolik on Saturday February 11, 2023 @05:58AM (#34751214)
Isn't your first paragraph all about not knowing what argument types the function accepts just looking at its declaration, as it defeats the purpose of using a dynamic language?
Re:Google Python Style Guide by Jensson on Saturday February 11, 2023 @06:09AM (#34751278)
Type hints supports generics and abstract interfaces, you use those to display what behaviour you are using within the function and then you try to do what you need in the function as dynamically as possible.

That is for library code, maybe it would be too cumbersome to try to do that for code with less reuse. I have never worked on a large python codebase that wasn't a library so I'm not sure what is best there.