You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some codebases I have seen that trailing commas are used in function definitions, especially when functions take a lot of keyword parameters and people frequently change or add them. Trailing commas then help with version control and guard against forgotten commas. You might argue whether this is good stile, but the following is valid python:
deffoo(arg1, arg2, arg3,):
returnbar
sphinx-doc then fails, because sphinx-doc-fun-args creates an empy string "" as the last arg. I fixed that in place by just removing empty strings from the argument list with remove "". But maybe there is a better place to implement a fix. I didn't go really went into understanding your code, so I refrained from a PR.
(defunsphinx-doc-fun-args (argstrs)
"Extract list of arg objects from string ARGSTRS.ARGSTRS is the string representing function definition in Python.Note that the arguments self, *args and **kwargs are ignored."
(when (not (string= argstrs ""))
(mapcar#'sphinx-doc-str->arg
(-filter
(lambda (str)
(and (not (string= (substring str 01) "*"))
(not (string= str "self"))))
(remove""
(mapcar#'s-trim
(split-string argstrs ",")))))))
The text was updated successfully, but these errors were encountered:
In some codebases I have seen that trailing commas are used in function definitions, especially when functions take a lot of keyword parameters and people frequently change or add them. Trailing commas then help with version control and guard against forgotten commas. You might argue whether this is good stile, but the following is valid python:
sphinx-doc
then fails, becausesphinx-doc-fun-args
creates an empy string""
as the last arg. I fixed that in place by just removing empty strings from the argument list withremove ""
. But maybe there is a better place to implement a fix. I didn't go really went into understanding your code, so I refrained from a PR.The text was updated successfully, but these errors were encountered: