use type hints for single dispatch

This commit is contained in:
Valentin Boettcher 2022-02-25 15:10:35 +01:00
parent 9f686f7585
commit 79e18a01c1

View file

@ -292,7 +292,7 @@ def custom_json(obj: Any) -> str:
return f"<{type(obj)} (not-hashed)>"
@custom_json.register(np.ndarray)
@custom_json
def _(arr: np.ndarray) -> str:
return np.array2string(arr, threshold=sys.maxsize)