Skip to content

Commit

Permalink
Fix annotations of CallList
Browse files Browse the repository at this point in the history
  • Loading branch information
ziima committed Oct 12, 2022
1 parent 27cb0c7 commit 046e706
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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 046e706

Please sign in to comment.