If skipkeys is false (the default), a TypeError will be raised when trying to encode keys that are not str, int, float or None. If skipkeys is true, such items are simply skipped.
However, boolean values (True and False) can be used as dictionary keys without raising a TypeError. I think this is a mistake.
json.JSONEncoder(skipkeys=False).encode({True:1})
Linked PRs