Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Disallow strings in logical ufuncs #21142

Merged
merged 1 commit into from Mar 3, 2022

Commits on Mar 2, 2022

  1. API: Disallow strings in logical ufuncs (numpy#21024)

    * API: Disallow strings in logical ufuncs
    
    This restores pre 1.22 NumPy behaviour for strings passed into logical
    ufuncs.  Logical ufuncs should be able to cast inputs to booleans
    without modifying their results.
    Thus they do this now (in NumPy 1.22+).  The problem is that string to
    bool casts are very strange in NumPy currently.
    
    This should be reverted/removed once string to bool casts are well
    defined.  But until then, it seems more reasonable to just reject
    strings.
    
    Closes numpygh-20898
    
    Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
    2 people authored and charris committed Mar 2, 2022
    Configuration menu
    Copy the full SHA
    87dc319 View commit details
    Browse the repository at this point in the history