Skip to content

finfo/iinfo accepts strings? #138

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

Closed
mdhaber opened this issue Mar 31, 2025 · 1 comment · Fixed by #143
Closed

finfo/iinfo accepts strings? #138

mdhaber opened this issue Mar 31, 2025 · 1 comment · Fixed by #143
Milestone

Comments

@mdhaber
Copy link

mdhaber commented Mar 31, 2025

According to the standard, the only acceptable types for the argument of finfo are dtype and array. However, finfo and iinfo currently accept strings.

import array_api_strict as xp
xp.finfo('float32')
# finfo_object(bits=32, eps=1.1920928955078125e-07, max=3.4028234663852886e+38, min=-3.4028234663852886e+38, smallest_normal=1.1754943508222875e-38, dtype=dtype('float32'))
# iinfo_object(bits=32, max=2147483647, min=-2147483648, dtype=dtype('int32'))

I'm not sure what the definition of the dtype type is, so this might be OK, but I'm guessing it's more flexible than intended.

@ev-br
Copy link
Member

ev-br commented Apr 1, 2025

cross-ref gh-116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants