Conversation
ev-br
reviewed
Sep 29, 2026
| ("__ror__", "bitwise_or", operator.or_, dh.bool_and_all_int_dtypes, 6, (1, 2)), | ||
| ("__rxor__", "bitwise_xor", operator.xor, dh.bool_and_all_int_dtypes, 6, (1, 2)), | ||
| ("__rlshift__", "bitwise_left_shift", operator.lshift, dh.all_int_dtypes, 3, (1, 2)), | ||
| ("__rrshift__", "bitwise_right_shift", operator.rshift, dh.all_int_dtypes, 8, (1, 2)), |
Member
There was a problem hiding this comment.
For consistency with the rest of the test suite, it'd be better to use hypothesis-generated values.
Contributor
Author
There was a problem hiding this comment.
The tests now draw scalars, array elements, and shapes with Hypothesis; the focused cases pass locally with array-api-strict and NumPy.
This branch has not been deployed
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.
The operator tests exercise array-left expressions but do not check scalar-left reflected arithmetic and bitwise operators. This adds Hypothesis-generated cases for the seven reflected arithmetic methods and five reflected bitwise methods, checking dtype, shape, and values against the corresponding Array API functions. Inputs stay small and finite, with nonzero divisors, small whole-number exponents, and valid shift counts.
The parametrized cases are materialized as a list so collection does not rely on pytest's deprecated support for generator arguments.
Validation: 115 reflected-operator cases pass with array-api-strict 2.6.1 (API 2025.12) and pytest 9.1.1, with
PytestRemovedIn10Warningtreated as an error. The full suite was not run locally.Refs #460