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

Fix number/boolean and nullable object generation #161

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

puc9
Copy link
Contributor

@puc9 puc9 commented Apr 2, 2024

Boolean is a type of int:

isinstance(True, (int, float))
True

Therefore, deciding if a value is a number or a boolean doesn't work.

The fix is either check for bool first then for number but then the correctness depends on the order of the operations.
Using the exact type match makes it a bit clearer IMHO.

@alufers alufers merged commit d9abbb5 into alufers:master Apr 3, 2024
2 checks passed
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.

2 participants