ipython / ipython/ipykernel

Serialize a dict with non-orderable keys

Open
#269 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
734
Forks
412
Avg merge
1d 5h
Merged PRs (30d)
8

Description

It seems that it is not possible to serialize a dict which a non-orderable keys:

```python
from ipykernel.serialize import serialize_object
serialize_object({'A': 1, 2: 2})

File "...\ipykernel\serialize.py", line 85, in serialize_object
for k in sorted(obj):
TypeError: '<' not supported between instances of 'int' and 'str'
```
Is ordering the keys mandatory to serialize the dict? (sorry if that is a dumb question)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.