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

Check for numeric type using numbers.Real #6802

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thangleiter
Copy link
Contributor

In several places code tests variables for numeric type using isinstance(value, (int, float)). This creates problems for native numpy types (among others I would presume). For example, isinstance(np.int32(0), int) evaluates to false.

Checking instead for numbers.Real should resolve this.

isinstance(np.int32(0), int) evaluates to false for example.
@thangleiter thangleiter requested a review from a team as a code owner January 17, 2025 11:52
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 this pull request may close these issues.

1 participant