forked from numpy/numpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request numpy#22385 from seberg/deprecate-out-of-bound-pyi…
…nt-conversion DEP: Deprecate conversion of out-of-bound Python integers
- Loading branch information
Showing
20 changed files
with
280 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Conversion of out-of-bound Python integers | ||
------------------------------------------ | ||
Attempting a conversion from a Python integer to a NumPy | ||
value will now always check whether the result can be | ||
represented by NumPy. This means the following examples will | ||
fail in the future and give a ``DeprecationWarning`` now:: | ||
|
||
np.uint8(-1) | ||
np.array([3000], dtype=np.int8) | ||
|
||
Many of these did succeed before. Such code was mainly | ||
useful for unsigned integers with negative values such as | ||
`np.uint8(-1)` giving `np.iinfo(np.uint8).max`. | ||
|
||
Note that conversion between NumPy integers is unaffected, | ||
so that `np.array(-1).astype(np.uint8)` continues to work | ||
and use C integer overflow logic. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.