Skip to content

fix(stubs): support float64 subtraction with float - #5366

Closed
mangeshraut712 wants to merge 1 commit into
meta:mainfrom
mangeshraut712:fix/float64-float-sub
Closed

mangeshraut712 wants to merge 1 commit into
meta:mainfrom
mangeshraut712:fix/float64-float-sub

Conversation

@mangeshraut712

Copy link
Copy Markdown
Contributor

Summary

np.float64 - float was reported as unsupported. Add a float64.__sub__ overload for built-in float (preserving float64) and a focused regression in the dtype-properties suite.

Fixes #5353

Test plan

  • Ruff format/check on changed files
  • run_runtime_tests.py --suite dtype-properties
  • CI

The shaped NumPy stubs lost the concrete float64 promotion for a Python float. Add a specific overload ahead of the generic numeric fallback so the operation is accepted and preserves its dtype.
@meta-codesync

meta-codesync Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D127482634. (Because this pull request was imported automatically, there will not be any future comments.)

@stroxler stroxler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@stroxler

Copy link
Copy Markdown
Contributor

Actually this is superseded by #5367 and they can't both land, so I'm closing this in favor of the other (thanks for working on this!)

@stroxler stroxler closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

- is not supported between float64 and float [unsupported-operation]

2 participants