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

[Python] Allow ints to be considered as floats/complexes and floats as complexes #32516

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

hjtran
Copy link
Contributor

@hjtran hjtran commented Sep 20, 2024

Currently, python Beam transforms will complain about type incompatibilities if you try to supply ints for floats/complexes or floats as complexes. It's not hard to work around this but it comes up fairly often and is a bit tedious to fix over and over when ints work fine in place of floats/complexes.

PEP484 states that ints should be compatible with floats/complexes and floats as complexes, so this change just updates our type check to allow for these special cases

Dev mail thread on this

Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @liferoad for label python.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Contributor

@jrmccluskey jrmccluskey left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Contributor

@robertwb robertwb left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this!

@robertwb
Copy link
Contributor

(Looks like there's a couple more tests to update.)

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.

3 participants