Skip to content

Commit

Permalink
type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Jun 17, 2022
1 parent 017c9e3 commit 3bc9b28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rich/_lru_cache.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from threading import Lock
from typing import Generic, List, Optional, TypeVar, Union, overload
from typing import Dict, Generic, List, Optional, TypeVar, Union, overload

CacheKey = TypeVar("CacheKey")
CacheValue = TypeVar("CacheValue")
Expand All @@ -23,7 +23,7 @@ class LRUCache(Generic[CacheKey, CacheValue]):

def __init__(self, maxsize: int) -> None:
self.maxsize = maxsize
self.cache: dict[CacheKey, List[object]] = {}
self.cache: Dict[CacheKey, List[object]] = {}
self.full = False
self.root: List[object] = []
self._lock = Lock()
Expand Down
4 changes: 2 additions & 2 deletions rich/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from functools import lru_cache
from marshal import dumps, loads
from random import randint
from typing import Any, Dict, Iterable, List, Optional, Type, Union, cast
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, Union, cast

from . import errors
from ._lru_cache import LRUCache
Expand Down Expand Up @@ -121,7 +121,7 @@ class Style:
}

# Caches results of Style.__add__
_add_cache: LRUCache[tuple["Style", Optional["Style"]], "Style"] = LRUCache(1024)
_add_cache: LRUCache[Tuple["Style", Optional["Style"]], "Style"] = LRUCache(1024)

def __init__(
self,
Expand Down

0 comments on commit 3bc9b28

Please sign in to comment.