File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1496,6 +1496,16 @@ to achieve the previous behavior.
1496
1496
1497
1497
(`gh-25712 <https://github.com/numpy/numpy/pull/25712 >`__)
1498
1498
1499
+ ``np.can_cast `` cannot be called on Python int, float, or complex
1500
+ -----------------------------------------------------------------
1501
+ ``np.can_cast `` cannot be called with Python int, float, or complex instances
1502
+ anymore. This is because NEP 50 means that the result of ``can_cast `` must
1503
+ not depend on the value passed in.
1504
+ Unfortunately, for Python scalars whether a cast should be considered
1505
+ ``"same_kind" `` or ``"safe" `` may depend on the context and value so that
1506
+ this is currently not implemented.
1507
+ In some cases, this means you may have to add a specific path for:
1508
+ ``if type(obj) in (int, float, complex): ... ``.
1499
1509
1500
1510
1501
1511
**Content from release note snippets in doc/release/upcoming_changes: **
You can’t perform that action at this time.
0 commit comments