[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

Serhiy Storchaka report at bugs.python.org
Sat Oct 30 13:23:16 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I agree. lru_cache(typed=True) itself should not look into iterable internals. It would be not only slow, but a change of semantic.

The simplest way to solve this issue is to remove caching of __getitem__(). The more sophisticated way is to move caching to lower level and apply it to a function with a var-positional parameter.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45679>
_______________________________________


More information about the Python-bugs-list mailing list