-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align casting methods with Python behaviour (#497)
* Introduce conservative `x.__complex__()` * Don't hard require same-kind arrays for builtin cast methods * Align casting methods with Python behaviour * Remove unnecessary `__int__` note on out-of-scope beyond bounds * `__index__`: leave bool arrays unspecified and restrict out to `int` * Update `__complex__` note with complex results * Clarify `__bool__` note language * "real-valued" -> "numeric" input array in `__bool__` note * Clearer and spec-consistent language for casting methods Co-authored-by: Athan <kgryte@gmail.com> * Special case neg zeros in `x.__int__()` * Special cases over note in `x.__bool__()` * Special cases over notes for boolean cross-kind casting * Add missing backticks * Update copy * Add special cases for real-valued floating-point operands Co-authored-by: Athan <kgryte@gmail.com>
- Loading branch information
Showing
2 changed files
with
77 additions
and
7 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
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