Skip to content

Commit

Permalink
Fix typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
keichi authored and Pierre-Sassoulas committed Apr 8, 2022
1 parent 837efed commit bc46064
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions astroid/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ def lru_cache_astroid(arg: typing.Optional[F] = None) -> F:
"""
cache: LRUCache[typing.Tuple[typing.Any, ...], typing.Any] = LRUCache()

@wrapt.decorator
@wrapt.decorator # type: ignore[misc] # wrapt.decorator is untyped
def decorator(
func: F,
instance: typing.Any,
args: typing.Tuple[typing.Any, ...],
kwargs: typing.Dict[typing.Any, typing.Any],
kwargs: typing.Dict[str, typing.Any],
) -> typing.Any:
key: typing.Tuple[typing.Any, ...] = (instance,) + args

for kv in kwargs:
key += kv
key += typing.cast(typing.Any, kv)

if key in cache:
result = cache[key]
Expand All @@ -91,12 +91,12 @@ def cached_generator(arg: typing.Optional[F] = None) -> F:
generator is consumed and cached as a list.
"""

@wrapt.decorator
@wrapt.decorator # type: ignore[misc] # wrapt.decorator is untyped
def decorator(
func: F,
instance: typing.Any,
args: typing.Tuple[typing.Any, ...],
kwargs: typing.Dict[typing.Any, typing.Any],
kwargs: typing.Dict[str, typing.Any],
) -> typing.Any:
key = func, args[0]

Expand Down

0 comments on commit bc46064

Please sign in to comment.