Repository navigation
Conversation
- Fixes issue numpy#6061 - Updated _npy_can_cast_safely_table to define such casts as not safe. - Updated existing python tests to be in agreement with this change. - Added new test case to test_regression.py to check safe cast example cited in issue numpy#6061
- Updated _npy_can_cast_safely_table to define cast from bool to string as unsafe - Deleted code block that tested string size to make sure int could fit in it when cast, for purposes of establishing whether the cast was safe. - Added assert tests to test_numeric.py to check np.can_cast to ensure that int and bools really are not safe to cast to strings.
Member
|
Revisit casting after the new dtypes go in |
Member
Member
|
Oh wow, I remember this at SciPy :). It was a nice excercise, the code looks quite different now so closing. My current angle is So while this can be discussed, the far more important step is the start on deprecating |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Made changes and added tests necessary to ensure that casting from int and bool to string is not treated as safe.
Note: even with these changes, there is still an open question about promotion, for example:
I did nothing to address this.
Link to issue: gh-6061