Skip to content

Commit a53ec8d

Browse files
committed
error message touch-up
1 parent 9155bd0 commit a53ec8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pydra/utils/typing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,18 +189,18 @@ def expand_and_coerce(obj, pattern: ty.Union[type, tuple]):
189189
obj_args = list(obj)
190190
except TypeError as e:
191191
msg = (
192-
f" (part of coercion from {object_} to {self.pattern}"
192+
f" (part of coercion from {object_!r} to {self.pattern}"
193193
if obj is not object_
194194
else ""
195195
)
196196
raise TypeError(
197-
f"Could not coerce to {type_} as {obj} is not iterable{msg}"
197+
f"Could not coerce to {type_} as {obj!r} is not iterable{msg}"
198198
) from e
199199
if issubclass(origin, tuple):
200200
return coerce_tuple(type_, obj_args, pattern_args)
201201
if issubclass(origin, ty.Iterable):
202202
return coerce_sequence(type_, obj_args, pattern_args)
203-
assert False, f"Coercion from {obj} to {pattern} is not handled"
203+
assert False, f"Coercion from {obj!r} to {pattern} is not handled"
204204

205205
def coerce_basic(obj, pattern):
206206
"""Coerce an object to a "basic types" like `int`, `float`, `bool`, `Path`

0 commit comments

Comments
 (0)