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 b958e84
Showing 1 changed file with 8 additions and 0 deletions.
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 b958e84

Please sign in to comment.