Re:Strict Python function parameters
by nyellin on Sunday January 23, 2022 @03:22PM
(#30050080)
You're right about the performance.
When I mentioned scaling I had in mind other issues with a large codebase - not actual performance at runtime.
For example, before type hints I found it difficult (even with PyCharm and other IDEs) to safely refactor code. I would end up missing specific usages of an old member name and discover it at runtime when the code raised an exception. In the best case scenario I would find it when running tests. In the worst case, in production.
Type hints make this a moot point, at least in real world usage. With type hints the IDE is smart enough to find all references when refactoring.
When I mentioned scaling I had in mind other issues with a large codebase - not actual performance at runtime.
For example, before type hints I found it difficult (even with PyCharm and other IDEs) to safely refactor code. I would end up missing specific usages of an old member name and discover it at runtime when the code raised an exception. In the best case scenario I would find it when running tests. In the worst case, in production.
Type hints make this a moot point, at least in real world usage. With type hints the IDE is smart enough to find all references when refactoring.