Skip to content

Commit d40fdfd

Browse files
committed
Enhance get_handler_info to support IRIS object instances in type annotation handling
1 parent 2009792 commit d40fdfd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/iop/_dispatch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ def get_handler_info(host: Any, method_name: str) -> Tuple[str, str] | None:
123123
# return it as is, assuming it's a fully qualified class name
124124
return annotation, method_name
125125

126+
if is_iris_object_instance(annotation):
127+
return f"{type(annotation).__module__}.{type(annotation).__name__}", method_name
128+
126129
if annotation == Parameter.empty or not isinstance(annotation, type):
130+
127131
return None
128132

129133
return f"{annotation.__module__}.{annotation.__name__}", method_name

0 commit comments

Comments
 (0)