Skip to content

Commit

Permalink
DOC: Extend out-of-bound python integer deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
seberg committed Oct 6, 2022
1 parent 0ca3a6d commit fb44bd1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion numpy/core/src/multiarray/arraytypes.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ static int
if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
"NumPy will stop allowing conversion of out-of-bound "
"Python integers to integer arrays. The conversion "
"of %.100R to %S will fail in the future.",
"of %.100R to %S will fail in the future.\n"
"For the old behavior, usually:\n"
" np.array(value).astype(dtype)`\n"
"will give the desired result (the cast overflows).",
obj, descr) < 0) {
Py_DECREF(descr);
return -1;
Expand Down

0 comments on commit fb44bd1

Please sign in to comment.