2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-28 20:53:35 +08:00

short_format: cover a few more numpy types correctly

This commit is contained in:
Robert Jördens 2016-05-21 20:11:08 +02:00
parent 9e681590cb
commit 0857cfdcb1

View File

@ -58,9 +58,9 @@ def short_format(v):
if v is None:
return "None"
t = type(v)
if t is bool or np.issubdtype(t, int) or np.issubdtype(t, float):
if np.issubdtype(t, np.number) or np.issubdtype(t, np.bool_):
return str(v)
elif t is str:
elif np.issubdtype(t, np.unicode_):
return "\"" + elide(v, 50) + "\""
else:
r = t.__name__