Skip to content

Commit

Permalink
Ignore 'cls' when it is the first argument
Browse files Browse the repository at this point in the history
  • Loading branch information
macurovc committed Nov 23, 2021
1 parent 21606fb commit 0100027
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions python-insert-docstring-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
" first: Type = 1,\n second: Map[some, other] = 2") '("first" "second")))
(should (equal (python-insert-docstring--get-arguments-names-from-string
" first = 1,\n second = 2") '("first" "second")))
(should (equal (python-insert-docstring--get-arguments-names-from-string
" cls ,\n second = 2") '("second")))
(should (equal (python-insert-docstring--get-arguments-names-from-string
" self ,\n second = 2") '("second")))))

Expand Down
3 changes: 1 addition & 2 deletions python-insert-docstring.el
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@
"Drop type data"
(car (split-string single-argument-string ":")))
(split-string arguments-string ","))))))
(if (string-equal (car arguments)
"self")
(if (member (car arguments) '("self" "cls"))
(cdr arguments)
arguments))))

Expand Down

0 comments on commit 0100027

Please sign in to comment.