@@ -100,7 +100,11 @@ def matches_arg_types(self, args, kwargs) -> "Result":
100100
101101 def sanitize_name (annotation ):
102102 # typing module annotations are likely to be better when pretty-printed due to including subscripts
103- return annotation if annotation .__module__ == "typing" else annotation .__qualname__
103+ return (
104+ annotation
105+ if annotation .__module__ == "typing"
106+ else f"{ annotation .__module__ } .{ annotation .__qualname__ } "
107+ )
104108
105109 def render_arg_type (arg : Any ) -> str :
106110 # it is more useful to report more detailed types for sequences/tuples in error messages
@@ -116,7 +120,7 @@ def render_arg_type(arg: Any) -> str:
116120 return f"List[Union[{ ', ' .join (arg_types )} ]]"
117121 if isinstance (arg , Tuple ):
118122 return f"Tuple[{ ', ' .join (map (render_arg_type , arg ))} ]"
119- return type (arg ).__qualname__
123+ return f" { type (arg ).__module__ } . { type ( arg ). __qualname__ } "
120124
121125 def matches_type (name : str , annotation : type , arg : Any ) -> bool :
122126 from collections .abc import Sequence as ABCSequence
@@ -174,6 +178,9 @@ def matches_type(name: str, annotation: type, arg: Any) -> bool:
174178
175179 for (name , annotation ), arg in zip (annotations .items (), args ):
176180 if not matches_type (name , annotation .type_info , arg ):
181+ import pdb
182+
183+ pdb .set_trace ()
177184 return Result .err (
178185 [
179186 f"For parameter: '{ name } ', expected an instance of type: '{ sanitize_name (annotation .type_info )} ' "
0 commit comments