diff options
author | Bas van Beek <b.f.van.beek@vu.nl> | 2020-06-25 13:27:14 +0200 |
---|---|---|
committer | Bas van Beek <b.f.van.beek@vu.nl> | 2020-06-25 13:27:14 +0200 |
commit | e5e75ccfb8d07151d8608b35bd6ac5006df6467e (patch) | |
tree | dff9cda6802d06cc9f28889a36df33d241b5be52 /numpy/tests | |
parent | c37dc5f1cf5d42ddf05e0cd04a7fc528f30f20e5 (diff) | |
download | numpy-e5e75ccfb8d07151d8608b35bd6ac5006df6467e.tar.gz |
Allow `None` to be passed to certain `generic` subclasses
Affected generic subclasses:
* `floating`
* `complexfloating`
* `datetime64`
Diffstat (limited to 'numpy/tests')
-rw-r--r-- | numpy/tests/typing/pass/scalars.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/tests/typing/pass/scalars.py b/numpy/tests/typing/pass/scalars.py index 7de182626..1c7ace282 100644 --- a/numpy/tests/typing/pass/scalars.py +++ b/numpy/tests/typing/pass/scalars.py @@ -21,6 +21,7 @@ np.complex64(3j) np.complex64(C()) np.complex128(3j) np.complex128(C()) +np.complex128(None) np.int8(4) np.int16(3.4) @@ -32,6 +33,7 @@ np.uint32() np.float16(A()) np.float32(16) np.float64(3.0) +np.float64(None) np.bytes_(b"hello") np.bytes_("hello", 'utf-8') @@ -66,10 +68,14 @@ np.datetime64() np.datetime64(0, "D") np.datetime64("2019") np.datetime64("2019", "D") +np.datetime64(None) +np.datetime64(None, "D") np.timedelta64() np.timedelta64(0) np.timedelta64(0, "D") +np.timedelta64(None) +np.timedelta64(None, "D") dt_64 = np.datetime64(0, "D") td_64 = np.timedelta64(1, "h") |