This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author uriyyo
Recipients kj, uriyyo
Date 2021-07-30.09:28:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1627637329.45.0.691022355252.issue44775@roundup.psfhosted.org>
In-reply-to
Content
In scope of https://github.com/python/cpython/pull/27262 we have introduce `_typing` module with typing related helper functions.

It will be great to speedup `typing.cast` function by implementing it in C.

I have already done it and here is results:
```
import timeit
import typing
import _typing

def _timeit(m):
    print(m.__name__, timeit.timeit("cast(int, 1)", globals={"cast": m.cast}))

_timeit(typing)
_timeit(_typing)
```

```
typing  0.0702372890082188
_typing 0.033294505992671475
```
History
Date User Action Args
2021-07-30 09:28:49uriyyosetrecipients: + uriyyo, kj
2021-07-30 09:28:49uriyyosetmessageid: <1627637329.45.0.691022355252.issue44775@roundup.psfhosted.org>
2021-07-30 09:28:49uriyyolinkissue44775 messages
2021-07-30 09:28:49uriyyocreate