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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 11 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy