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

Make sure is_ax_equal returns a boolean #2714

Closed
wants to merge 1 commit into from

Conversation

saitcakmak
Copy link
Contributor

Summary:
This is an alternative to D61666276 that addresses some of the issues raised there.
Instead of checking for type equality, which is too restrictive, we attempt to cast the output of the equality comparison to a boolean. If the cast or the comparison fails, we return False. This ensures that the output of is_ax_equal is always a boolean and can be used in if statements.

Also documented some of the special cases used in this method, as its behavior can sometimes be unintuitive.

Differential Revision: D61803910

Summary:
This is an alternative to D61666276 that addresses some of the issues raised there.
Instead of checking for type equality, which is too restrictive, we attempt to cast the output of the equality comparison to a boolean. If the cast or the comparison fails, we return False. This ensures that the output of `is_ax_equal` is always a boolean and can be used in `if` statements.

Also documented some of the special cases used in this method, as its behavior can sometimes be unintuitive.

Differential Revision: D61803910
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 26, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D61803910

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.29%. Comparing base (c76f52f) to head (2880f2c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2714   +/-   ##
=======================================
  Coverage   95.28%   95.29%           
=======================================
  Files         493      493           
  Lines       47919    47926    +7     
=======================================
+ Hits        45662    45669    +7     
  Misses       2257     2257           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in af8eab3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants