Skip to content

Commit

Permalink
Fix annotations of CallList (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziima committed Oct 12, 2022
1 parent 27cb0c7 commit 26bb973
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES
@@ -1,3 +1,8 @@
0.23.0
------

* Fix type annotations of `CallList`.

0.22.0
------

Expand Down
8 changes: 8 additions & 0 deletions responses/__init__.py
Expand Up @@ -230,6 +230,14 @@ def __iter__(self) -> Iterator[Call]:
def __len__(self) -> int:
return len(self._calls)

@overload
def __getitem__(self, idx: int) -> Call:
...

@overload
def __getitem__(self, idx: slice) -> List[Call]:
...

def __getitem__(self, idx: Union[int, slice]) -> Union[Call, List[Call]]:
return self._calls[idx]

Expand Down

0 comments on commit 26bb973

Please sign in to comment.