Skip to content

Commit a3f3f37

Browse files
authored
Merge pull request #304 from jakevdp/callable-repr
Avoid noisy JSON seralization warning for callables (e.g. numpy ufuncs)
2 parents 266dc7e + 8a98bb1 commit a3f3f37

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: reporting.py

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ def to_json_serializable(o):
3333
return tuple(to_json_serializable(i) for i in o)
3434
if isinstance(o, list):
3535
return [to_json_serializable(i) for i in o]
36+
if callable(o):
37+
return repr(o)
3638

3739
# Ensure everything is JSON serializable. If this warning is issued, it
3840
# means the given type needs to be added above if possible.

0 commit comments

Comments
 (0)