We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3797c3 commit 38ad84fCopy full SHA for 38ad84f
ipykernel/jsonutil.py
@@ -123,14 +123,6 @@ def json_clean(obj):
123
return [json_clean(x) for x in obj]
124
125
if isinstance(obj, dict):
126
- # First, validate that the dict won't lose data in conversion due to
127
- # key collisions after stringification. This can happen with keys like
128
- # True and 'true' or 1 and '1', which collide in JSON.
129
- nkeys = len(obj)
130
- nkeys_collapsed = len(set(map(str, obj)))
131
- if nkeys != nkeys_collapsed:
132
- raise ValueError('dict cannot be safely converted to JSON: '
133
- 'key collision would lead to dropped values')
134
# If all OK, proceed by making the new dict that will be json-safe
135
out = {}
136
for k, v in obj.items():
0 commit comments