3 ms·
As far as I know type hints don't affect Python's performance, because they're optional and not yet used by the runtime. In any case, JavaScript is dynamically
by hyperpape 11y ago
As far as I know type hints don't affect Python's performance, because they're optional and not yet used by the runtime.
In any case, JavaScript is dynamically/unityped, so its performance is unlikely to provide a reason for type annotations. The real problem here is that PyPy is still maturing, and can't be used by many people because of legacy C extensions.
- gsnedders 11y agoAn they're unlikely ever to be used by the runtime, because what hints there are are far too vague. Saying something is class X is useless when you don't know what attributes that class has (because they can be dynamically added and removed) nor what types those attributes are.
- techdragon 11y agoThe level if information modern Python tools like those in PyCharm and JEDI can reason through to and discover about runtime behaviour is actually pretty impressive. I don't think it's going to pose a huge challenge for these kinds if tools to find. Dealing with ambiguous cases is a UI problem, too much info, not enough space.
- rudolf0 11y agoThey don't affect performance, but I have to agree they really don't look nice to read or write, which is unfortunately the antithesis of Python's philosophy.