[Python-ideas] Performance improvements via static typing

Michael Hall python-ideas at michaelhall.tech
Thu Jul 19 09:51:38 EDT 2018

While I am aware of projects like Cython and mypy, it seems to make sense
for CPython to allow optional enforcement of type hints, with compiler
optimizations related to it to be used. While this would not receive the
same level of performance benefits as using ctypes directly, there do
appear to be various gains available here.

My main concern with this as a thought was how to specify type hints as
optional, as for maximum benefit, this shouldn't prevent the ability to
type hint functions that you don't want to be treated in this manner. While
I don't have an answer for that yet, I thought I'd toss the idea out there
first. If it needs to be seen in action before deciding if it makes sense
to add, I can work on a potential implementation soon, but right now, this
is just an idea.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180719/b28beeef/attachment.html>

More information about the Python-ideas mailing list