typeshed
typeshed copied to clipboard
cachetools.TTLCache: ttl parameter should be float
The cachetools.TTLCache implementation is happy to support sub-second time-to-live. The official documentation says nothing about ttl needing to be an integer either.
import cachetools
cachetools.TTLCache(maxsize=10, ttl=0.1)
mypy 0.790 output:
2: Argument "ttl" to "TTLCache" has incompatible type "float"; expected "int"