diff options
-rw-r--r-- | polymatrix/polymatrix/typing.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/polymatrix/polymatrix/typing.py b/polymatrix/polymatrix/typing.py index 8626cf3..79b8161 100644 --- a/polymatrix/polymatrix/typing.py +++ b/polymatrix/polymatrix/typing.py @@ -169,6 +169,9 @@ class PolyMatrixDict(UserDict[MatrixIndex, PolyDict]): return super().__setitem__(key, value) + def __getitem__(self, key: tuple[int, int] | MatrixIndex) -> PolyDict: + return super().__getitem__(cast(MatrixIndex, key)) + def entries(self) -> Iterable[tuple[MatrixIndex, PolyDict]]: yield from self.items() |