-
-
Notifications
You must be signed in to change notification settings - Fork 613
Documentation shows incorrect default values for keyword-only arguments #39627
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
Comments
Partial diagnosis. The problem seems to be in
The By the way, I don't think the positional-only separator "/" is being handled, either, but it doesn't seem to arise in the sagemath source code yet. |
Hi, I'm new to contributing to sage but have had a look at this. The functions inspect.getargs and inspect.GetFullArgSpec are deprecated and I have replaced them in one block with inspect.getfullargspec, which returns correct signatures. I've tested this on the two pages mentioned and also on the example afunc given. There are some further uses of deprecated functions elsewhere in this function, but I am unsure of what would trigger these branches so have left them as is. I have a PR #39774 ready for review |
I don't think this is a good first issue, because I think the fix is probably not straightforward, and will need to be done with care. Did you read these paragraphs in the docstring of
The methods need to work for cython functions, not just python functions. |
Steps To Reproduce
The signature of the method
sage.categories.enumerated_sets.EnumeratedSets.ParentMethods.map
ismap(self, f, name=None, *, is_injective=True)
, but the documentation showsmap(f, name, is_injective=None)
. (See this doc page.)Expected Behavior
The documentation should show the correct signature of the method.
Actual Behavior
There are two problems with the signature that is presented in the documentation:
name
argument is erroneously given tois_injective
instead.is_injective
is a keyword-only argument.Additional Information
The problems are not unique to this method -- they also show up in the documentation of other methods that have a keyword-only argument, such as sage.combinat.designs.bibd.BalancedIncompleteBlockDesign.arc. It appears to me that sphinx/autodoc is shifting the default values one step to the right.
Environment
Checklist
The text was updated successfully, but these errors were encountered: