Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Yeah, it's great practice to implement it as it will obviously help you and others understand your code. :)
Also it helps your IDE to give you the right suggestions for auto-completion. -
uuid27747yYess, type hinting in Python 3 is such a great feature, and using in your code only makes it more readable and it helps you as the coder to know what the function you're calling expects and what it returns.
-
Personally I don't allow any code to be merged in that doesn't pass `mypy --strict`
-
woops84467yWell looking through opinions i saw people go against it since it disables the python philosophy and looks more static type language
-
uuid27747y@woodworks I didn't know about that command, I'm surely gonna add it to my CI/CD process.
-
Regardless of what the plebs claim, strong typing in a language is absolutely important
-
brocklee277yPersonally I don't use type hints mostly because I don't find them necessary. In terms of readability, I find the variable and function name to usually describe the intention of a function of argument. In terms of performance, type hints don't improve performance since python does not perform any optimizations based on types.
Been wondering lately. Do Python devs use type hinting? Shall i start implementing it?
I find it this way, a bit more clear about what the method is doing
question