Skip to content

Commit

Permalink
Adds covariant true to key
Browse files Browse the repository at this point in the history
  • Loading branch information
spacether committed Jul 20, 2023
1 parent e2d2aaa commit ac4c5c9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions immutabledict/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__version__ = "2.2.5"

_K = TypeVar("_K")
_V = TypeVar("_V")
_V = TypeVar("_V", covariant=True)


class immutabledict(Mapping[_K, _V]):
Expand Down Expand Up @@ -35,9 +35,6 @@ def __getitem__(self, key: _K) -> _V:
def __contains__(self, key: object) -> bool:
return key in self._dict

def copy(self, **add_or_replace: _V) -> immutabledict[_K, _V]:
return self.__class__(self, **add_or_replace)

def __iter__(self) -> Iterator[_K]:
return iter(self._dict)

Expand Down

0 comments on commit ac4c5c9

Please sign in to comment.