inveniosoftware / dojson

Simple pythonic JSON to JSON converter.
https://dojson.readthedocs.io
Other
10 stars 29 forks source link

utils: filter_values() is not GroupableOrderedDict aware #161

Closed kaplun closed 7 years ago

kaplun commented 8 years ago

Take this snippet:

>>> from dojson.utils import GroupableOrderedDict, force_values
>>> a = GroupableOrderedDict([('a', None)])
>>> @filter_values
>>> def foo(b):
...     return b
>>> foo(a)
{'__order__': ('a',)}

Instead the correct result should have been:

>>> foo(a)
{'__order__': ()}