-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
Inconsistency in json.JSONEncoder Description Regarding skipkeys Behavior #132021
Comments
bools are ints, so the statement is technically true. >>> isinstance(True, int)
True
>>> isinstance(False, int)
True Although maybe it makes sense to add |
Thank you, I understand. I noticed that the description of json.dump includes bool. It would be better to keep it consistent.
|
Seems good - would you like to put up a PR? |
… in keys of encode(...) method
However, boolean values (True and False) can be used as dictionary keys without raising a TypeError. I think this is a mistake.
Linked PRs
The text was updated successfully, but these errors were encountered: