Skip to content

Commit 5a9d570

Browse files
authored
Merge pull request #20 from pixelneo/self
fix
2 parents 3964f68 + 61a8b70 commit 5a9d570

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

python/asthelper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _handle_functions(self, node):
8888
if arg.annotation is not None:
8989
type_hint = ast.unparse(arg.annotation)
9090
self.arguments.append({'arg': arg.arg, 'type': type_hint})
91-
if len(self.arguments) > 0 and (self.arguments[0] == 'self' or self.arguments[0] == 'cls'):
91+
if len(self.arguments) > 0 and (self.arguments[0]['arg'] == 'self' or self.arguments[0]['arg'] == 'cls'):
9292
self.arguments.pop(0)
9393

9494
self.returns = new_visitor.returns

python/pydocstring.py

-11
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,6 @@ def write_docstring(self, print_hints=False):
200200
method_indent, args, returns, yields, raises, print_hints)
201201
self.env.append_after_line(sig_line, docstring)
202202

203-
def _arguments(self, tree):
204-
try:
205-
args = []
206-
for arg in tree.body[0].args.args:
207-
args.append(arg.arg)
208-
if args[0] == 'self' or args[0] == 'cls':
209-
args.pop(0)
210-
return args
211-
except SyntaxError as e:
212-
raise InvalidSyntax('The method has invalid syntax.')
213-
214203

215204
class ClassController(ObjectWithDocstring):
216205

0 commit comments

Comments
 (0)