Skip to content

Commit 88c96be

Browse files
committed
lint
1 parent 1edd657 commit 88c96be

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

effectful/internals/unification.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,10 @@ def _iterable_element_type(value: collections.abc.Iterable) -> TypeExpression:
11211121
@nested_type.register
11221122
def _(value: collections.abc.Iterator):
11231123
try:
1124-
ctor, args, *state = value.__reduce__() # type: ignore[misc]
1124+
reduced = value.__reduce__()
1125+
if isinstance(reduced, str):
1126+
return Box(type(value)) # reduced to a global name; opaque
1127+
ctor, args, *state = reduced
11251128
_ = [nested_type(arg).value for arg in args]
11261129
except (TypeError, AttributeError):
11271130
return Box(type(value)) # un-reducible iterators are opaque

0 commit comments

Comments
 (0)