Skip to content

Commit 1e96ca5

Browse files
committed
Made more modifications to extract_pyi.py
1 parent d1664bd commit 1e96ca5

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tools/extract_pyi.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ def convert_folder(top_level, stub_directory):
6262
print(i.__dict__['name'])
6363
for j in i.body:
6464
if isinstance(j, astroid.scoped_nodes.FunctionDef):
65-
for i in j.args.__dict__['annotations']:
66-
if type(i) == astroid.node_classes.Name:
67-
if i.name == 'Any':
65+
for k, l in zip(j.args.__dict__['annotations'], j.args.__dict__['args']):
66+
# K is type, l is name
67+
if l.name != 'self':
68+
if not k:
6869
print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n")
70+
elif str(type(k)) == "<class 'astroid.node_classes.Name'>":
71+
if k.name == 'Any':
72+
print(f"'Any' parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n")
6973
if j.returns:
7074
if 'Any' in j.returns.__dict__.values():
7175
print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}")

0 commit comments

Comments
 (0)