News for hackers. Stuff that matters.
Re:Google Python Style Guide by kroolik on Saturday February 11, 2023 @05:38AM (#34751133)
On the other hand, big codebases without type hints rely on their engineers remembering types of every argument. Or the functions being overly defensive.

Each to their own liking, I prefer knowing what argument types a function accepts so I don't need to think about it, and focus on writing business logic. If the function could accept more types, Id just improve it.

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.