New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escape combined args kwargs #7799
Conversation
I've still not read this PR yet. But please rebase this into 3.x branch if you feel this is not breaking change. The master branch is used for the next major release (4.0) and it will be released next spring. So it's not good for minor changes. |
I'll review this later (maybe this weekend) |
77a8188
to
95ec45b
Compare
done. Is the reason why AppVeyor fails due to a change proposed in this PR? |
gentle ping, @tk0miya |
That's true, but I think it's a separate issue: this PR tries to avoid the "Inline strong emphasis start-string without end-string." warnings for |
Yes, it's another issue. But we need to consider how fix it. At present, I think it is better to separate (copy) the attribute entry that contains multiple variables with comma to independent entries. After the change, this fix might not be needed. |
that issue is because with
and it seems that the I still would say that it's fine to work on these separately (this is issue has been there for a long time) and I'd be fine with merging this only after that issue has been fixed. I'd even try to do that myself, but I'd first like to finish #7690 and resolve #7908. |
debugging this a bit, the issue is that :param foo: description of parameter foo
:type foo: SomeClass and :param SomeClass foo: description of parameter foo so the sphinx/sphinx/util/docfields.py Lines 323 to 330 in a443538
If instead this was try:
argtype, argname = fieldarg.split(None, 1)
if argtype.endswith(","):
raise ValueError
except ValueError:
pass
else:
types.setdefault(typename, {})[argname] = \
[nodes.Text(argtype)]
fieldarg = argname using something like Edit: I assumed that's okay and that I should include it in this PR (if not please do tell me) |
I prefer to copy a parameter entry including comma to multiple entries. Because
|
As long as modifying Other than that, I don't really like the duplicated entries, because if we mention
and while I think we're free to deviate, that's not the way |
In order to resolve this: would you merge this without the fix (only the escape of the combined We can then investigate / discuss the fix in a separate PR. I think this issue was also reported as #7780? |
00edd32
to
478ab44
Compare
Reasonable. Thank you for your advice. I'll do it in another PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do it in another PR.
Just to make sure, I didn't apply the copy / split patch, yet. Is that something you'd do in that separate PR, too?
Now I just post a PR for the copy / split patch as #8056 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the quick update. awesome!
I'll review this again tomorrow (with fresh eyes) and merge it soon.
sure. Also, thanks for opening the other PR for me. |
Merged! Thank you for your continuous contribution! |
numpydoc
allows combining parameters:but when trying to do that with
*args
and**kwargs
, only the*
ofargs
will be escaped. This changes that to also allow the combined form if they are separated by,
.It will also warn if someone tried something like
*args, *kwargs
or*args, **kwargs, **other_kwargs
or**kwargs, *args
(which don't really make sense), but the warning lacks location information and I also don't know how to check for warnings in tests.I wrote this against
master
but I don't think it is a breaking change. Should I try to rebase onto3.x
?