We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d03a3b3 commit 0fe816cCopy full SHA for 0fe816c
mypy/plugins/functools.py
@@ -410,9 +410,9 @@ def functools_lru_cache_callback(ctx: mypy.plugin.FunctionContext) -> Type:
410
first_arg_type = ctx.arg_types[0][0]
411
412
# Explicitly check that this is NOT a literal or other non-function type
413
- from mypy.types import Instance, LiteralType
414
-
415
- if isinstance(first_arg_type, (LiteralType, Instance)):
+ from mypy.types import LiteralType, Instance
+ proper_first_arg_type = get_proper_type(first_arg_type)
+ if isinstance(proper_first_arg_type, (LiteralType, Instance)):
416
# This is likely maxsize=128 or similar - let MyPy handle it
417
return ctx.default_return_type
418
0 commit comments