diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2021-06-10 12:11:54 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-10 12:11:54 -0600 |
commit | bd3daa61e6580cdfdc2398945df425fef719170d (patch) | |
tree | a962136a36a6f941ddd769feb41b59910ea02ea4 | |
parent | ea335bc7d2df5baab56df8f561fccffef172bfea (diff) | |
parent | 584dd3a9e5c847cbd21eb50d4c39496c54303caf (diff) | |
download | numpy-bd3daa61e6580cdfdc2398945df425fef719170d.tar.gz |
Merge pull request #19218 from BvB93/complex
MAINT: Add `complex` as allowed type for the `np.complexfloating` constructors
-rw-r--r-- | numpy/__init__.pyi | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi index ec38d4943..a83e5d9c7 100644 --- a/numpy/__init__.pyi +++ b/numpy/__init__.pyi @@ -3129,11 +3129,24 @@ class datetime64(generic): if sys.version_info >= (3, 8): _IntValue = Union[SupportsInt, _CharLike_co, SupportsIndex] _FloatValue = Union[None, _CharLike_co, SupportsFloat, SupportsIndex] - _ComplexValue = Union[None, _CharLike_co, SupportsFloat, SupportsComplex, SupportsIndex] + _ComplexValue = Union[ + None, + _CharLike_co, + SupportsFloat, + SupportsComplex, + SupportsIndex, + complex, # `complex` is not a subtype of `SupportsComplex` + ] else: _IntValue = Union[SupportsInt, _CharLike_co] _FloatValue = Union[None, _CharLike_co, SupportsFloat] - _ComplexValue = Union[None, _CharLike_co, SupportsFloat, SupportsComplex] + _ComplexValue = Union[ + None, + _CharLike_co, + SupportsFloat, + SupportsComplex, + complex, + ] class integer(number[_NBit1]): # type: ignore # NOTE: `__index__` is technically defined in the bottom-most |