-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
gh-96354: Port docstring of unicode_find
family to Argument Clinic
#96356
base: main
Are you sure you want to change the base?
Conversation
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
fdc7872
to
f494673
Compare
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
I'm fixing failure in It seems not so straightforward for the Argument Clinic to do the same thing as
|
Should we implement this behavior in Argument Clinic?
cpython/Objects/stringlib/find.h Lines 85 to 117 in e860e52
|
I believe we should implements it as argument converters of
|
By the way, thank you for using In addition to the porting, I've clarified the docstrings a little; you can do this too:
|
Another useful feature of the clinic: you can set a return type to |
Actually, you can freely take parts from my branch. |
Wow, that's neat. You are a really Argument Clinic Ninja.
It really helps! And would you mind I add you as an author in my future commit?
|
Sure, no problem. |
f494673
to
08b8bdd
Compare
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
An early version, just @arhadthedev And I add your name as co-author ;)
I search in the codebase, and few function generated by clinic is using this feature. And no function in
About the test I changed:
Remove the left parenthesis in test cases like Take
|
b68e866
to
43d94ec
Compare
7 out of 9 methods are ported to Argument Clinic.
I think this PR is in a good enough shape to be reviewed.
About
|
parse_args_finds_byte(const char *function_name, PyObject *args, | |
PyObject **subobj, char *byte, | |
Py_ssize_t *start, Py_ssize_t *end) | |
{ | |
PyObject *tmp_subobj; | |
Py_ssize_t ival; | |
if(!stringlib_parse_args_finds(function_name, args, &tmp_subobj, | |
start, end)) |
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
43d94ec
to
0792275
Compare
There are 9 method docstring in
str
, which is not consistent to the rest.PyDoc_STRVAR
docstring generation.count
,endswith
,find
,format
,format_map
,index
,rfind
,rindex
andstartswith
str
#96354