summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBas van Beek <43369155+BvB93@users.noreply.github.com>2021-06-10 18:10:27 +0200
committerBas van Beek <43369155+BvB93@users.noreply.github.com>2021-06-10 18:19:12 +0200
commit584dd3a9e5c847cbd21eb50d4c39496c54303caf (patch)
tree30031e28bb6be104abffd62884da17aa3fce4f69
parentdae36b3d26724fdaa5d17656d79e9daf68517321 (diff)
downloadnumpy-584dd3a9e5c847cbd21eb50d4c39496c54303caf.tar.gz
MAINT: Add `complex` as allowed type for the `np.complexfloating` constructor
-rw-r--r--numpy/__init__.pyi17
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