diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2020-01-01 19:21:11 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2020-01-01 19:39:23 +0000 |
commit | bc6d573a58bf8a8f4448f26ed220afff93df7c97 (patch) | |
tree | 5d36d6f7120f1b53242d94c37c21a7980e435a59 /numpy/array_api/_array_object.py | |
parent | fdd8395f21a252373ff17fd43185c42e040c1b64 (diff) | |
download | numpy-bc6d573a58bf8a8f4448f26ed220afff93df7c97.tar.gz |
DEP: records: Deprecate treating shape=0 as shape=None
`shape=n` is a shorthand for `shape=(n,)` except in the case when `n==0`, when it is a shorthand for `shape=None`.
This special case is dangerous, as it makes `fromrecords(..., shape=len(a))` behave surprisingly when a is an empty sequence.
Users impacted by this warning either:
* Have a bug in their code, and will need to either:
- wait for the deprecation to expire
- change their code to use `(len(a),)` instead of `len(a)`
* Are using the non-preferred spellling, and will need to replace a literal `0` or `False` with `None`
Diffstat (limited to 'numpy/array_api/_array_object.py')
0 files changed, 0 insertions, 0 deletions