Skip to content

Commit 0100027

Browse files
committed
Ignore 'cls' when it is the first argument
1 parent 21606fb commit 0100027

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

python-insert-docstring-tests.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@
111111
" first: Type = 1,\n second: Map[some, other] = 2") '("first" "second")))
112112
(should (equal (python-insert-docstring--get-arguments-names-from-string
113113
" first = 1,\n second = 2") '("first" "second")))
114+
(should (equal (python-insert-docstring--get-arguments-names-from-string
115+
" cls ,\n second = 2") '("second")))
114116
(should (equal (python-insert-docstring--get-arguments-names-from-string
115117
" self ,\n second = 2") '("second")))))
116118

python-insert-docstring.el

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@
158158
"Drop type data"
159159
(car (split-string single-argument-string ":")))
160160
(split-string arguments-string ","))))))
161-
(if (string-equal (car arguments)
162-
"self")
161+
(if (member (car arguments) '("self" "cls"))
163162
(cdr arguments)
164163
arguments))))
165164

0 commit comments

Comments
 (0)