We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5526c7a commit 2a9f128Copy full SHA for 2a9f128
1 file changed
parsers/parser.py
@@ -599,9 +599,13 @@ def parse_returns(self, contents):
599
if len(match) == 0:
600
return None
601
602
+ hint = re.search(r'^\s*def \w*\(.*\)\s*->\s*(.*):', contents)
603
+ if hint:
604
+ hint = hint.group(1)
605
+
606
match = match[0]
607
return_type = match[0] + 's'
- return_value_type = guess_type_from_value(match[1])
608
+ return_value_type = hint or guess_type_from_value(match[1])
609
610
return (return_type, {'type': return_value_type})
611
0 commit comments