GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CI,TYP: Bump mypy to 1.4.1 by BvB93 · Pull Request #23764 · numpy/numpy

CI,TYP: Bump mypy to 1.4.1 #23764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
rgommers merged 7 commits into numpy:main from BvB93:mypy
Aug 25, 2023

Uh oh!

There was an error while loading. Please reload this page.

Merged

CI,TYP: Bump mypy to 1.4.1 #23764

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit Hold shift + click to select a range
a0c70f3
CI,TYP: Bump mypy to 1.3.0
BvB93 Apr 24, 2023
4a74d38
TYP: Improve function-based annotations with `typing.Concatenate`
BvB93 May 15, 2023
9b636a1
CI: Avoid overriding `MYPYPATH`
BvB93 May 17, 2023
1be0c4c
TYP: Bump mypy to 1.5.1
BvB93 Aug 23, 2023
f23c5ae
TYP: Lower the mypy pin to 1.4.1
BvB93 Aug 23, 2023
6f52ecb
TYP,TST: Adapt the typing test suite to mypy >=1.4 changes
BvB93 Aug 23, 2023
8de2ed5
TYP: guard `typing_extensions` usage for <py310, add it back in envir…
rgommers Aug 24, 2023
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
TYP,TST: Adapt the typing test suite to mypy >=1.4 changes
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@BvB93
BvB93 committed Aug 23, 2023
commit 6f52ecbd7bdf20d32a34e6d2834bfdf10fe502c3

There are no files selected for viewing

8 changes: 4 additions & 4 deletions 8 numpy/typing/tests/data/reveal/array_constructors.pyi
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ reveal_type(np.linspace(0, 10)) # E: ndarray[Any, dtype[floating[Any]]]
reveal_type(np.linspace(0, 10j)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]]
reveal_type(np.linspace(0, 10, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]]
reveal_type(np.linspace(0, 10, dtype=int)) # E: ndarray[Any, dtype[Any]]
reveal_type(np.linspace(0, 10, retstep=True)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], floating[Any]]
reveal_type(np.linspace(0j, 10, retstep=True)) # E: Tuple[ndarray[Any, dtype[complexfloating[Any, Any]]], complexfloating[Any, Any]]
reveal_type(np.linspace(0, 10, retstep=True, dtype=np.int64)) # E: Tuple[ndarray[Any, dtype[{int64}]], {int64}]
reveal_type(np.linspace(0j, 10, retstep=True, dtype=int)) # E: Tuple[ndarray[Any, dtype[Any]], Any]
reveal_type(np.linspace(0, 10, retstep=True)) # E: tuple[ndarray[Any, dtype[floating[Any]]], floating[Any]]
reveal_type(np.linspace(0j, 10, retstep=True)) # E: tuple[ndarray[Any, dtype[complexfloating[Any, Any]]], complexfloating[Any, Any]]
reveal_type(np.linspace(0, 10, retstep=True, dtype=np.int64)) # E: tuple[ndarray[Any, dtype[{int64}]], {int64}]
reveal_type(np.linspace(0j, 10, retstep=True, dtype=int)) # E: tuple[ndarray[Any, dtype[Any]], Any]

reveal_type(np.logspace(0, 10)) # E: ndarray[Any, dtype[floating[Any]]]
reveal_type(np.logspace(0, 10j)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]]
Expand Down
30 changes: 15 additions & 15 deletions 30 numpy/typing/tests/data/reveal/arraysetops.pyi
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ reveal_type(np.ediff1d(AR_LIKE_f8, to_begin=[1, 1.5])) # E: ndarray[Any, dtype[
reveal_type(np.intersect1d(AR_i8, AR_i8)) # E: ndarray[Any, dtype[{int64}]]
reveal_type(np.intersect1d(AR_M, AR_M, assume_unique=True)) # E: ndarray[Any, dtype[datetime64]]
reveal_type(np.intersect1d(AR_f8, AR_i8)) # E: ndarray[Any, dtype[Any]]
reveal_type(np.intersect1d(AR_f8, AR_f8, return_indices=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.intersect1d(AR_f8, AR_f8, return_indices=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]

reveal_type(np.setxor1d(AR_i8, AR_i8)) # E: ndarray[Any, dtype[{int64}]]
reveal_type(np.setxor1d(AR_M, AR_M, assume_unique=True)) # E: ndarray[Any, dtype[datetime64]]
Expand All @@ -44,17 +44,17 @@ reveal_type(np.setdiff1d(AR_f8, AR_i8)) # E: ndarray[Any, dtype[Any]]

reveal_type(np.unique(AR_f8)) # E: ndarray[Any, dtype[{float64}]]
reveal_type(np.unique(AR_LIKE_f8, axis=0)) # E: ndarray[Any, dtype[Any]]
reveal_type(np.unique(AR_f8, return_index=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_index=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_index=True, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_index=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_index=True, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_index=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_index=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_inverse=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_inverse=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_counts=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_counts=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_index=True, return_inverse=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_index=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_inverse=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_inverse=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_f8, return_index=True, return_inverse=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True, return_counts=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]]
2 changes: 1 addition & 1 deletion 2 numpy/typing/tests/data/reveal/dtype.pyi
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ reveal_type(np.dtype(("U", 10))) # E: dtype[void]

# Methods and attributes
reveal_type(dtype_U.base) # E: dtype[Any]
reveal_type(dtype_U.subdtype) # E: Union[None, Tuple[dtype[Any], builtins.tuple[builtins.int, ...]]]
reveal_type(dtype_U.subdtype) # E: Union[None, tuple[dtype[Any], builtins.tuple[builtins.int, ...]]]
reveal_type(dtype_U.newbyteorder()) # E: dtype[str_]
reveal_type(dtype_U.type) # E: Type[str_]
reveal_type(dtype_U.name) # E: str
Expand Down
16 changes: 8 additions & 8 deletions 16 numpy/typing/tests/data/reveal/einsumfunc.pyi
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsaf
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f, dtype="c16")) # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe")) # E: Any

reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_b)) # E: Tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_u, AR_LIKE_u)) # E: Tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_i, AR_LIKE_i)) # E: Tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_f, AR_LIKE_f)) # E: Tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_c, AR_LIKE_c)) # E: Tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_i)) # E: Tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c)) # E: Tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_b)) # E: tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_u, AR_LIKE_u)) # E: tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_i, AR_LIKE_i)) # E: tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_f, AR_LIKE_f)) # E: tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_c, AR_LIKE_c)) # E: tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_i)) # E: tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c)) # E: tuple[builtins.list[Any], builtins.str]

reveal_type(np.einsum([[1, 1], [1, 1]], AR_LIKE_i, AR_LIKE_i)) # E: Any
reveal_type(np.einsum_path([[1, 1], [1, 1]], AR_LIKE_i, AR_LIKE_i)) # E: Tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path([[1, 1], [1, 1]], AR_LIKE_i, AR_LIKE_i)) # E: tuple[builtins.list[Any], builtins.str]
16 changes: 8 additions & 8 deletions 16 numpy/typing/tests/data/reveal/histograms.pyi
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ reveal_type(np.histogram_bin_edges(AR_i8, bins="auto")) # E: ndarray[Any, dtype
reveal_type(np.histogram_bin_edges(AR_i8, bins="rice", range=(0, 3))) # E: ndarray[Any, dtype[Any]]
reveal_type(np.histogram_bin_edges(AR_i8, bins="scott", weights=AR_f8)) # E: ndarray[Any, dtype[Any]]

reveal_type(np.histogram(AR_i8, bins="auto")) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]
reveal_type(np.histogram(AR_i8, bins="rice", range=(0, 3))) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]
reveal_type(np.histogram(AR_i8, bins="scott", weights=AR_f8)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]
reveal_type(np.histogram(AR_f8, bins=1, density=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]
reveal_type(np.histogram(AR_i8, bins="auto")) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]
reveal_type(np.histogram(AR_i8, bins="rice", range=(0, 3))) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]
reveal_type(np.histogram(AR_i8, bins="scott", weights=AR_f8)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]
reveal_type(np.histogram(AR_f8, bins=1, density=True)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]

reveal_type(np.histogramdd(AR_i8, bins=[1])) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]]
reveal_type(np.histogramdd(AR_i8, range=[(0, 3)])) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]]
reveal_type(np.histogramdd(AR_i8, weights=AR_f8)) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]]
reveal_type(np.histogramdd(AR_f8, density=True)) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]]
reveal_type(np.histogramdd(AR_i8, bins=[1])) # E: tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]]
reveal_type(np.histogramdd(AR_i8, range=[(0, 3)])) # E: tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]]
reveal_type(np.histogramdd(AR_i8, weights=AR_f8)) # E: tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]]
reveal_type(np.histogramdd(AR_f8, density=True)) # E: tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]]
16 changes: 8 additions & 8 deletions 16 numpy/typing/tests/data/reveal/index_tricks.pyi
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ reveal_type(np.ndenumerate(AR_i8).iter) # E: flatiter[ndarray[Any, dtype[{int64
reveal_type(np.ndenumerate(AR_LIKE_f).iter) # E: flatiter[ndarray[Any, dtype[{double}]]]
reveal_type(np.ndenumerate(AR_LIKE_U).iter) # E: flatiter[ndarray[Any, dtype[str_]]]

reveal_type(next(np.ndenumerate(AR_i8))) # E: Tuple[builtins.tuple[builtins.int, ...], {int64}]
reveal_type(next(np.ndenumerate(AR_LIKE_f))) # E: Tuple[builtins.tuple[builtins.int, ...], {double}]
reveal_type(next(np.ndenumerate(AR_LIKE_U))) # E: Tuple[builtins.tuple[builtins.int, ...], str_]
reveal_type(next(np.ndenumerate(AR_i8))) # E: tuple[builtins.tuple[builtins.int, ...], {int64}]
reveal_type(next(np.ndenumerate(AR_LIKE_f))) # E: tuple[builtins.tuple[builtins.int, ...], {double}]
reveal_type(next(np.ndenumerate(AR_LIKE_U))) # E: tuple[builtins.tuple[builtins.int, ...], str_]

reveal_type(iter(np.ndenumerate(AR_i8))) # E: ndenumerate[{int64}]
reveal_type(iter(np.ndenumerate(AR_LIKE_f))) # E: ndenumerate[{double}]
Expand Down Expand Up @@ -46,13 +46,13 @@ reveal_type(np.mgrid[1:1:2, None:10]) # E: ndarray[Any, dtype[Any]]
reveal_type(np.ogrid[1:1:2]) # E: list[ndarray[Any, dtype[Any]]]
reveal_type(np.ogrid[1:1:2, None:10]) # E: list[ndarray[Any, dtype[Any]]]

reveal_type(np.index_exp[0:1]) # E: Tuple[builtins.slice]
reveal_type(np.index_exp[0:1, None:3]) # E: Tuple[builtins.slice, builtins.slice]
reveal_type(np.index_exp[0, 0:1, ..., [0, 1, 3]]) # E: Tuple[Literal[0]?, builtins.slice, builtins.ellipsis, builtins.list[builtins.int]]
reveal_type(np.index_exp[0:1]) # E: tuple[builtins.slice]
reveal_type(np.index_exp[0:1, None:3]) # E: tuple[builtins.slice, builtins.slice]
reveal_type(np.index_exp[0, 0:1, ..., [0, 1, 3]]) # E: tuple[Literal[0]?, builtins.slice, builtins.ellipsis, builtins.list[builtins.int]]

reveal_type(np.s_[0:1]) # E: builtins.slice
reveal_type(np.s_[0:1, None:3]) # E: Tuple[builtins.slice, builtins.slice]
reveal_type(np.s_[0, 0:1, ..., [0, 1, 3]]) # E: Tuple[Literal[0]?, builtins.slice, builtins.ellipsis, builtins.list[builtins.int]]
reveal_type(np.s_[0:1, None:3]) # E: tuple[builtins.slice, builtins.slice]
reveal_type(np.s_[0, 0:1, ..., [0, 1, 3]]) # E: tuple[Literal[0]?, builtins.slice, builtins.ellipsis, builtins.list[builtins.int]]

reveal_type(np.ix_(AR_LIKE_b)) # E: tuple[ndarray[Any, dtype[bool_]], ...]
reveal_type(np.ix_(AR_LIKE_i, AR_LIKE_f)) # E: tuple[ndarray[Any, dtype[{double}]], ...]
Expand Down
8 changes: 4 additions & 4 deletions 8 numpy/typing/tests/data/reveal/lib_function_base.pyi
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ reveal_type(np.iterable([1])) # E: bool
reveal_type(np.average(AR_f8)) # E: floating[Any]
reveal_type(np.average(AR_f8, weights=AR_c16)) # E: complexfloating[Any, Any]
reveal_type(np.average(AR_O)) # E: Any
reveal_type(np.average(AR_f8, returned=True)) # E: Tuple[floating[Any], floating[Any]]
reveal_type(np.average(AR_f8, weights=AR_c16, returned=True)) # E: Tuple[complexfloating[Any, Any], complexfloating[Any, Any]]
reveal_type(np.average(AR_O, returned=True)) # E: Tuple[Any, Any]
reveal_type(np.average(AR_f8, returned=True)) # E: tuple[floating[Any], floating[Any]]
reveal_type(np.average(AR_f8, weights=AR_c16, returned=True)) # E: tuple[complexfloating[Any, Any], complexfloating[Any, Any]]
reveal_type(np.average(AR_O, returned=True)) # E: tuple[Any, Any]
reveal_type(np.average(AR_f8, axis=0)) # E: Any
reveal_type(np.average(AR_f8, axis=0, returned=True)) # E: Tuple[Any, Any]
reveal_type(np.average(AR_f8, axis=0, returned=True)) # E: tuple[Any, Any]

reveal_type(np.asarray_chkfinite(AR_f8)) # E: ndarray[Any, dtype[{float64}]]
reveal_type(np.asarray_chkfinite(AR_LIKE_f8)) # E: ndarray[Any, dtype[Any]]
Expand Down
20 changes: 10 additions & 10 deletions 20 numpy/typing/tests/data/reveal/lib_polynomial.pyi
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ reveal_type(np.polyder(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, An
reveal_type(np.polyder(AR_O, m=2)) # E: ndarray[Any, dtype[object_]]

reveal_type(np.polyfit(AR_f8, AR_f8, 2)) # E: ndarray[Any, dtype[{float64}]]
reveal_type(np.polyfit(AR_f8, AR_i8, 1, full=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[signedinteger[typing._32Bit]]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]]
reveal_type(np.polyfit(AR_u4, AR_f8, 1.0, cov="unscaled")) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]]
reveal_type(np.polyfit(AR_f8, AR_i8, 1, full=True)) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[signedinteger[typing._32Bit]]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]]
reveal_type(np.polyfit(AR_u4, AR_f8, 1.0, cov="unscaled")) # E: tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]]
reveal_type(np.polyfit(AR_c16, AR_f8, 2)) # E: ndarray[Any, dtype[{complex128}]]
reveal_type(np.polyfit(AR_f8, AR_c16, 1, full=True)) # E: Tuple[ndarray[Any, dtype[{complex128}]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[signedinteger[typing._32Bit]]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]]
reveal_type(np.polyfit(AR_u4, AR_c16, 1.0, cov=True)) # E: Tuple[ndarray[Any, dtype[{complex128}]], ndarray[Any, dtype[{complex128}]]]
reveal_type(np.polyfit(AR_f8, AR_c16, 1, full=True)) # E: tuple[ndarray[Any, dtype[{complex128}]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[signedinteger[typing._32Bit]]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]]
reveal_type(np.polyfit(AR_u4, AR_c16, 1.0, cov=True)) # E: tuple[ndarray[Any, dtype[{complex128}]], ndarray[Any, dtype[{complex128}]]]

reveal_type(np.polyval(AR_b, AR_b)) # E: ndarray[Any, dtype[{int64}]]
reveal_type(np.polyval(AR_u4, AR_b)) # E: ndarray[Any, dtype[unsignedinteger[Any]]]
Expand Down Expand Up @@ -103,9 +103,9 @@ reveal_type(np.polymul(AR_O, AR_O)) # E: ndarray[Any, dtype[object_]]

reveal_type(np.polydiv(poly_obj, AR_i8)) # E: poly1d
reveal_type(np.polydiv(AR_f8, poly_obj)) # E: poly1d
reveal_type(np.polydiv(AR_b, AR_b)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]]
reveal_type(np.polydiv(AR_u4, AR_b)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]]
reveal_type(np.polydiv(AR_i8, AR_i8)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]]
reveal_type(np.polydiv(AR_f8, AR_i8)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]]
reveal_type(np.polydiv(AR_i8, AR_c16)) # E: Tuple[ndarray[Any, dtype[complexfloating[Any, Any]]], ndarray[Any, dtype[complexfloating[Any, Any]]]]
reveal_type(np.polydiv(AR_O, AR_O)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]
reveal_type(np.polydiv(AR_b, AR_b)) # E: tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]]
reveal_type(np.polydiv(AR_u4, AR_b)) # E: tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]]
reveal_type(np.polydiv(AR_i8, AR_i8)) # E: tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]]
reveal_type(np.polydiv(AR_f8, AR_i8)) # E: tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]]
reveal_type(np.polydiv(AR_i8, AR_c16)) # E: tuple[ndarray[Any, dtype[complexfloating[Any, Any]]], ndarray[Any, dtype[complexfloating[Any, Any]]]]
reveal_type(np.polydiv(AR_O, AR_O)) # E: tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]
4 changes: 2 additions & 2 deletions 4 numpy/typing/tests/data/reveal/lib_utils.pyi
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ FILE: StringIO

def func(a: int) -> bool: ...

reveal_type(np.byte_bounds(AR)) # E: Tuple[builtins.int, builtins.int]
reveal_type(np.byte_bounds(np.float64())) # E: Tuple[builtins.int, builtins.int]
reveal_type(np.byte_bounds(AR)) # E: tuple[builtins.int, builtins.int]
reveal_type(np.byte_bounds(np.float64())) # E: tuple[builtins.int, builtins.int]

reveal_type(np.info(1, output=FILE)) # E: None

Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.