Skip to content

Commit a8356de

Browse files
committed
optimize: Let deprecated OptimizeResult inherit from Any.
This is to allow attribute access to not just be `None`.
1 parent cb73190 commit a8356de

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

scipy-stubs/optimize/cobyla.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# This file is not meant for public use and will be removed in SciPy v2.0.0.
22

3-
from typing_extensions import deprecated
3+
from typing_extensions import Any, deprecated
44

55
__all__ = ["OptimizeResult", "fmin_cobyla"]
66

77
@deprecated("will be removed in SciPy v2.0.0")
8-
class OptimizeResult: ...
8+
class OptimizeResult(Any): ...
99

1010
@deprecated("will be removed in SciPy v2.0.0")
1111
def fmin_cobyla(

scipy-stubs/optimize/lbfgsb.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is not meant for public use and will be removed in SciPy v2.0.0.
22

3-
from typing_extensions import deprecated
3+
from typing_extensions import Any, deprecated
44

55
__all__ = ["LbfgsInvHessProduct", "OptimizeResult", "fmin_l_bfgs_b", "zeros"]
66

@@ -14,7 +14,7 @@ def zeros(
1414
like: object = ...,
1515
) -> object: ...
1616
@deprecated("will be removed in SciPy v2.0.0")
17-
class OptimizeResult: ...
17+
class OptimizeResult(Any): ...
1818

1919
@deprecated("will be removed in SciPy v2.0.0")
2020
def fmin_l_bfgs_b(

scipy-stubs/optimize/minpack.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is not meant for public use and will be removed in SciPy v2.0.0.
22

3-
from typing_extensions import deprecated
3+
from typing_extensions import Any, deprecated
44

55
__all__ = ["OptimizeResult", "OptimizeWarning", "curve_fit", "fixed_point", "fsolve", "least_squares", "leastsq", "zeros"]
66

@@ -14,7 +14,7 @@ def zeros(
1414
like: object = ...,
1515
) -> object: ...
1616
@deprecated("will be removed in SciPy v2.0.0")
17-
class OptimizeResult: ...
17+
class OptimizeResult(Any): ...
1818

1919
@deprecated("will be removed in SciPy v2.0.0")
2020
class OptimizeWarning(UserWarning): ...

scipy-stubs/optimize/optimize.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is not meant for public use and will be removed in SciPy v2.0.0.
22

3-
from typing_extensions import deprecated
3+
from typing_extensions import Any, deprecated
44

55
__all__ = [
66
"OptimizeResult",
@@ -36,7 +36,7 @@ def zeros(
3636
like: object = ...,
3737
) -> object: ...
3838
@deprecated("will be removed in SciPy v2.0.0")
39-
class OptimizeResult: ...
39+
class OptimizeResult(Any): ...
4040

4141
@deprecated("will be removed in SciPy v2.0.0")
4242
class OptimizeWarning(UserWarning): ...

scipy-stubs/optimize/slsqp.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is not meant for public use and will be removed in SciPy v2.0.0.
22

33
from collections.abc import Callable
4-
from typing_extensions import deprecated
4+
from typing_extensions import Any, deprecated
55

66
__all__ = ["OptimizeResult", "fmin_slsqp", "slsqp", "zeros"]
77

@@ -15,7 +15,7 @@ def zeros(
1515
like: object = ...,
1616
) -> object: ...
1717
@deprecated("will be removed in SciPy v2.0.0")
18-
class OptimizeResult: ...
18+
class OptimizeResult(Any): ...
1919

2020
@deprecated("will be removed in SciPy v2.0.0")
2121
def fmin_slsqp(

scipy-stubs/optimize/tnc.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is not meant for public use and will be removed in SciPy v2.0.0.
22

3-
from typing_extensions import deprecated
3+
from typing_extensions import Any, deprecated
44

55
__all__ = ["OptimizeResult", "fmin_tnc", "zeros"]
66

@@ -14,7 +14,7 @@ def zeros(
1414
like: object = ...,
1515
) -> object: ...
1616
@deprecated("will be removed in SciPy v2.0.0")
17-
class OptimizeResult: ...
17+
class OptimizeResult(Any): ...
1818

1919
@deprecated("will be removed in SciPy v2.0.0")
2020
def fmin_tnc(

0 commit comments

Comments
 (0)