diff options
| author | Charles Harris <charlesr.harris@gmail.com> | 2021-10-05 08:38:58 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-05 08:38:58 -0600 |
| commit | e021c8c0edb5c0a31ff4a545192547f91d42edd9 (patch) | |
| tree | fb2d58bb6fbc5a26a0285c6697e5020e33d800e0 /numpy | |
| parent | 79a8986b3caf55ffe5caf715b09faa055e38d342 (diff) | |
| parent | 5cdf3230b321ba679857acfe5dee6822f14d5ab8 (diff) | |
| download | numpy-e021c8c0edb5c0a31ff4a545192547f91d42edd9.tar.gz | |
Merge pull request #20037 from BvB93/range
MAINT: Fixed an issue wherein `npt._NestedSequence` was not a `range` supertype
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/typing/_nested_sequence.py | 5 | ||||
| -rw-r--r-- | numpy/typing/tests/data/reveal/nested_sequence.pyi | 1 |
2 files changed, 2 insertions, 4 deletions
diff --git a/numpy/typing/_nested_sequence.py b/numpy/typing/_nested_sequence.py index e3b8fc33f..a853303ca 100644 --- a/numpy/typing/_nested_sequence.py +++ b/numpy/typing/_nested_sequence.py @@ -2,7 +2,6 @@ from __future__ import annotations -import sys from typing import ( Any, Iterator, @@ -86,8 +85,6 @@ class _NestedSequence(Protocol[_T_co]): """Return the number of occurrences of `value`.""" raise NotImplementedError - def index( - self, value: Any, start: int = 0, stop: int = sys.maxsize, / - ) -> int: + def index(self, value: Any, /) -> int: """Return the first index of `value`.""" raise NotImplementedError diff --git a/numpy/typing/tests/data/reveal/nested_sequence.pyi b/numpy/typing/tests/data/reveal/nested_sequence.pyi index 07e24e357..4d3aad467 100644 --- a/numpy/typing/tests/data/reveal/nested_sequence.pyi +++ b/numpy/typing/tests/data/reveal/nested_sequence.pyi @@ -21,3 +21,4 @@ reveal_type(func(e)) # E: None reveal_type(func(f)) # E: None reveal_type(func(g)) # E: None reveal_type(func(h)) # E: None +reveal_type(func(range(15))) # E: None |
