Minimal Python object that can't be uJson'd

241 Views Asked by At

Ujson (and probably other json libraries) for python will reject some objects. A good example is Ulid; you can't put a Ulid into a dict and then expect uJson to correctly dump it. However if I make an empty class, uJson will happily encode it. I'd like to write a unit test that shows that we correctly handle objects that will cause ujson to choke, but I'd rather not import a library just for that purpose. What's a minimal python object that can't be ujson'd?

0

There are 0 best solutions below