diff options
| author | Bas van Beek <b.f.van.beek@vu.nl> | 2021-10-05 14:20:38 +0200 |
|---|---|---|
| committer | Bas van Beek <b.f.van.beek@vu.nl> | 2021-10-05 14:20:38 +0200 |
| commit | 5cdf3230b321ba679857acfe5dee6822f14d5ab8 (patch) | |
| tree | fb2d58bb6fbc5a26a0285c6697e5020e33d800e0 /numpy | |
| parent | 79a8986b3caf55ffe5caf715b09faa055e38d342 (diff) | |
| download | numpy-5cdf3230b321ba679857acfe5dee6822f14d5ab8.tar.gz | |
MAINT: Fixed an issue wherein `npt._NestedSequence` did not supertype `range`
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 |
