File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -40,3 +40,22 @@ def get_handler(cls, helper_name):
4040 def has_handler (cls , helper_name ):
4141 """Check if a handler function is registered for a helper"""
4242 return helper_name in cls ._handlers
43+
44+ @classmethod
45+ def get_signature (cls , helper_name ):
46+ """Get the signature of a helper function"""
47+ return cls ._handlers .get (helper_name )
48+
49+ @classmethod
50+ def get_param_type (cls , helper_name , index ):
51+ """Get the type of a parameter of a helper function by the index"""
52+ signature = cls .get_signature (helper_name )
53+ if signature and 0 <= index < len (signature .arg_types ):
54+ return signature .arg_types [index ]
55+ return None
56+
57+ @classmethod
58+ def get_return_type (cls , helper_name ):
59+ """Get the return type of a helper function"""
60+ signature = cls .get_signature (helper_name )
61+ return signature .return_type if signature else None
You can’t perform that action at this time.
0 commit comments