Hi Sebastian,
One thing this breaks is the following, which is part of SciPy's testsuite:
```
@pytest.mark.parametrize("dtype", np.typecodes['All'])
...
np.eye(2, dtype=dtype)
```
Is there a recommended alternative for downstream libraries who want to test
with ~all dtypes easily, but not all dtypes?
https://github.com/scipy/scipy/actions/runs/23708171067/job/69063440694?pr=24921
Cheers,
Lucas
________________________________
From: Sebastian Berg <[email protected]>
Sent: 29 March 2026 11:37
To: Discussion of Numerical Python <[email protected]>
Subject: [Numpy-discussion] Deprecating unitless timedelta/datetime
Hi all,
I just merged a PR: https://github.com/numpy/numpy/pull/29619
to deprecate unitless timdeldta/datetime64. This is a step in a direction
that should be e.g. very helpful for pandas to make timedelta/datetimes
less weird.
That said, we didn't touch this for a long time, because it is also
very hard to really understand how and if users might be impacted.
So if you notice this, or maybe even think you may be mixing timedeltas
with normal integers/floats a lot you may want to try this branch.
This is a `DeprecationWarning`, so it shouldn't out-right break code in
production.
Note that there are also specific things we could try to make more
gentle, even something niche like specifically allowing:
`timdelta_arr == 0` (although `timedelta_arr.astype(bool)` should be a
plausible replacement as well, I think).
Or generally keep allowing `timedelta_arr + integer_arr`, etc. which,
with this PR, I believe should give a warning.
Cheers,
Sebastian
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/numpy-discussion.python.org
Member address: [email protected]
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/numpy-discussion.python.org
Member address: [email protected]