support bfkey

This commit is contained in:
Valentin Boettcher 2022-01-20 16:34:38 +01:00
parent 779a09c609
commit 38a0b63c61

View file

@ -193,6 +193,9 @@ def custom_json(obj: Any) -> str:
if np.isscalar(obj):
return str(obj)
if hasattr(obj, "__bfkey__"):
return f"<{type(obj)} ({obj.__bfkey__()})>"
return f"<{type(obj)} (not-hashed)>"