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
Argument Clinic: functions with valid sig but no docstring have no __text_signature__ #64785
Comments
Builtins with a valid signature embedded in the docstring, but with no other docstring content are not picked up by the __text_signature__ getter because the docstring ends with ")\n--" rather than ")\n--\n\n". The attached patch adjusts clinic.CLanguage.docstring_for_c_string to make sure that the rendered docstring ends in "--\n\n" rather than "--". The result is a correct __text_signature__ and a __doc__ of ''. |
Forgot to mention, there are no current examples of this checked in. winreg.HKEYType has a couple of methods with no docstring (enter and __exit__), and _winapi has several docstring-less functions, though. |
This looks reasonable to me. However I'd also change _PyType_GetDocFromInternalDoc() so that it also returns None if the first byte of the doc is \0. |
Something about like this? Note that this does change the behavior in the case where the whole docstring is empty but provided (such as when WITH_DOC_STRINGS == 0; see the changed line in test_capi). |
Here's an updated patch for clean application. Larry, could you give this a look? |
LGTM |
New changeset e75fd221a53e by Zachary Ware in branch 'default': |
Thanks Larry |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: