Re:The different uses of Python type hints
by dragonwriter on Saturday April 15, 2023 @07:32PM
(#35585719)
> The only reason to consider type hints is for a performance increase
No, the reason to consider type hints is because it makes it easier to understand existing code and write new code that interacts with it correctly. Comprehensibility and correctness are more important than performace.
Re:The different uses of Python type hints
by Heston on Monday April 17, 2023 @02:37PM
(#35604683)
In a loosely typed language, that's what comments are for. Since you didn't need types specified in the first place, why would you have trouble with interacting with it? Comprehensibility and correctness are just as important as performance.
No, the reason to consider type hints is because it makes it easier to understand existing code and write new code that interacts with it correctly. Comprehensibility and correctness are more important than performace.