From d5b3910095ce276893d8850bb2231bec4556ef39 Mon Sep 17 00:00:00 2001 From: jorenham Date: Fri, 18 Oct 2024 17:12:29 +0200 Subject: [PATCH] accept broader boolean arguments in `scipy.linalg.norm` --- scipy-stubs/linalg/_misc.pyi | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scipy-stubs/linalg/_misc.pyi b/scipy-stubs/linalg/_misc.pyi index aeafc92e..08a7cd4e 100644 --- a/scipy-stubs/linalg/_misc.pyi +++ b/scipy-stubs/linalg/_misc.pyi @@ -4,6 +4,7 @@ import numpy as np import numpy.typing as npt import optype.typing as opt from numpy.linalg import LinAlgError # noqa: ICN003 +from scipy._typing import AnyBool __all__ = ["LinAlgError", "LinAlgWarning", "norm"] @@ -14,16 +15,16 @@ def norm( a: npt.ArrayLike, ord: Literal["fro", "nuc", 0, 1, -1, 2, -2] | float | None = None, axis: None = None, - keepdims: bool = False, - check_finite: bool = True, + keepdims: AnyBool = False, + check_finite: AnyBool = True, ) -> np.float64: ... @overload def norm( a: npt.ArrayLike, ord: Literal["fro", "nuc", 0, 1, -1, 2, -2] | float | None, axis: opt.AnyInt | tuple[opt.AnyInt, ...], - keepdims: bool = False, - check_finite: bool = True, + keepdims: AnyBool = False, + check_finite: AnyBool = True, ) -> np.float64 | npt.NDArray[np.float64]: ... @overload def norm( @@ -31,6 +32,6 @@ def norm( ord: Literal["fro", "nuc", 0, 1, -1, 2, -2] | float | None = None, *, axis: opt.AnyInt | tuple[opt.AnyInt, ...], - keepdims: bool = False, - check_finite: bool = True, + keepdims: AnyBool = False, + check_finite: AnyBool = True, ) -> np.float64 | npt.NDArray[np.float64]: ...