> On 26 Aug 2020, at 17:02, krishnans2...@gmail.com wrote: > > One suggestion I had for the next Python release is to add type-implication > support. Many developers have learned Python, but do not want to use it since > it is slow. An awesome way to fix this is to have optional type-implications. > For example, if you know for sure that variable x is an int, you can make > Python just a bit smaller by somehow specifying to the interpreter that the > variable is an integer. Something like 'x::int = 5'. By having optional type > implications, you can still do everything you do with normal Python, except > you can speed it up a little bit by telling the Interpreter that this > variable is starting off with this datatype.
Python as type annotations, but those are primarily used for type checking using tools such as mypy and are not used by the interpreter itself. PyPy is an implementation of Python that includes an advanced JIT compiler, and their FAQ mentions that having type annotations won’t help for performance, even if they’d look at them. See: https://doc.pypy.org/en/latest/faq.html#would-type-annotations-help-pypy-s-performance <https://doc.pypy.org/en/latest/faq.html#would-type-annotations-help-pypy-s-performance>. Ronald — Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/3G24YXW5HQ7YTCSGNEBZFE7FNID34EKV/ Code of Conduct: http://python.org/psf/codeofconduct/