Skip to content

Commit 1bce5da

Browse files
authored
Merge pull request #120 from jakirkham/fix_astype_repr
Fix representation of AsType's dtypes
2 parents aeb1354 + 28b480d commit 1bce5da

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

zarr/codecs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,10 @@ def get_config(self):
557557

558558
def __repr__(self):
559559
return (
560-
'%s(encode_dtype=%s, decode_dtype=%s)' % (
560+
'%s(encode_dtype=%r, decode_dtype=%r)' % (
561561
type(self).__name__,
562-
self.encode_dtype,
563-
self.decode_dtype
562+
self.encode_dtype.str,
563+
self.decode_dtype.str
564564
)
565565
)
566566

zarr/tests/test_codecs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def test_decode_input(self):
347347

348348
def test_repr(self):
349349
codec = self.init_codec(encode_dtype='i4', decode_dtype='i8')
350-
expect = 'AsType(encode_dtype=int32, decode_dtype=int64)'
350+
expect = "AsType(encode_dtype='<i4', decode_dtype='<i8')"
351351
actual = repr(codec)
352352
eq(expect, actual)
353353

0 commit comments

Comments
 (0)