Skip to content

Commit 8101d76

Browse files
committed
Manually handle __setitem__ not having a Returns section in the sepc
1 parent 4f161dd commit 8101d76

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

generate_stubs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,10 @@ def parse_annotations(spec_text, all_annotations, verbose=False):
696696
if is_returns:
697697
param = 'return'
698698
is_returns = False
699+
if name == '__setitem__':
700+
# setitem returns None so it doesn't have a Returns
701+
# section in the spec
702+
annotations[name]['return'] = 'None'
699703
typ = clean_type(typ)
700704
if verbose:
701705
print(f"Matched parameter for {name}: {param}: {typ}")

0 commit comments

Comments
 (0)