Skip to content

Commit 10dda96

Browse files
tcloseeffigies
andauthored
Apply suggestions from code review
Co-authored-by: Chris Markiewicz <[email protected]>
1 parent 61411e9 commit 10dda96

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pydra/utils/hash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def type_name(tp):
242242
origin = ty.get_origin(klass)
243243
if origin:
244244
yield f"{origin.__module__}.{type_name(origin)}[".encode()
245-
yield from bytes_repr_sequence_contents(ty.get_args(klass), cache)
245+
yield from (b for t in ty.get_args(klass) for b in bytes_repr_type(t, cache))
246246
yield b"]"
247247
else:
248248
yield f"{klass.__module__}.{type_name(klass)}".encode()

pydra/utils/tests/test_hash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class MyClass(ty.Generic[T]):
181181
pass
182182

183183
obj_repr = join_bytes_repr(MyClass[int])
184-
assert re.match(rb"type:\(pydra.utils.tests.test_hash.MyClass\[.{16}\]\)", obj_repr)
184+
assert obj_repr == b"type:(pydra.utils.tests.test_hash.MyClass[type:(int)])"
185185

186186

187187
def test_bytes_special_form1():

0 commit comments

Comments
 (0)