-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Derby #10: Convert 50 sites to Argument Clinic across 4 files #64378
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
This issue is part of the Great Argument Clinic Conversion Derby, This issue asks you to change the following bundle of files: Talk to me (larry) if you only want to attack part of a bundle. For instructions on how to convert a function to work with Argument |
While converting Objects/stringlib/transmogrify.h as part of bpo-20180 (Derby #11), some changes to Objects/bytesobject.c and Objects/bytearrayobject.c were required. Those changes are included in the relevant patch attached to that issue. |
Attached patch for AC conversion of Objects/bytesobject.c and Objects/bytearrayobject.c. This is one patch because there are changes that must be done in bytes_methods.h and bytes_methods.c that affect both of bytesobject.c and bytearrayobject.c. Those changes are in this patch as well. All methods were converted except for two groups:
Also note that both of these classes use some common function implementations found under 'stringlib'. However, since that code is in separate files, I'll upload the conversion patches to the relevant issue (and write an appropriate comment here). |
Attached updated patch for bytes and bytearray. In the previous patch I missed the 'clear' and 'copy' bytearray methods. This patch is a replacement for the previous one, with the additional conversion of these two methods. |
New changeset 4d3d0659b55e by Martin v. Löwis in branch 'default': |
Tal: Thanks for the patch. I applied it with updates to the current Argument Clinic. _ssl and _overlapped are still to be done. |
All the Derby patches should only go into trunk at this point. |
Proposed patch converts the _ssl module to Argument Clinic. Total 39 methods converted. |
I'm concerned the _ssl changes will make security backports significantly more difficult. |
_ssl.enum_certificates() and _ssl.enum_crls() is not converted because their parsing code look incorrect (bpo-23875). |
The patch updated to the tip. |
New changeset 1eaaf27b3956 by Serhiy Storchaka in branch 'default': |
I'm with Alex. The move to argument clinic is going to make it very hard to port patches to older versions of Python, especially Python 2.7. |
Sorry. Should I rollback 1eaaf27b3956? |
I have no opinion on whether this is a good thing or not. Security backports should be few and far between, so I don't think it's a big problem if they are a bit more difficult. |
How often are patches backported to 2.7? While I understand the sentiment, I'd like to understand the scale of the objection being raised. I suspect it's infrequent, making the objection a minor one. |
You are right, patches are seldomly backported to Python 2.7. Features are never backported. Well, except for one exception: the ssl module. :) |
I think it's worthwhile to maintain the ability to easily backport patches from 3.x to 2.7, especially given the security sensitive nature of the ssl module. |
We discussed it in IRC a bit (and I got a little education). I can propose three remedies: A) back out the Clinic conversion in _ssl.c IMO these are in my reverse order of preference; I'd prefer C, then B, then A. But I'm not supporting _ssl.c, you guys are. And I want you maintainers to be happy. So I'll abide by / help you in implementing whatever you prefer. FWIW, option C would mean doing an otherwise-inert backport of the current _ssl.c from trunk to 2.7, so that we could also backport (by hand) Modules/clinic/_ssl.c. Then, if in the future, when you change _ssl.c you still copy that file over and tweak it. But: if you change the arguments to a function, you'd have to *hand-edit* Modules/clinic/_ssl.c to match. |
Le 03/05/2015 23:06, Larry Hastings a écrit :
Can we have a transcript somewhere? |
Attached. Glad you asked right away, it would have been a lot harder to get later! |
Thank you! |
I'd rather have A or C than B. |
Clinic's syntax is diverging from what shipped with 3.4. So if you copied _ssl.c over, it wouldn't work with the Clinic that shipped with 3.4. Maybe the best thing is if Clinic in trunk supports "legacy mode", where the code it generates is compatible with previous Python versions. That's basically B but without doing something crazy like shipping Clinic with 2.7. |
Can someone clarify whether Modules/overlapped.c should be converted to use AC? |
PR 14275 converts Modules/overlapped.c. Many methods now use METH_FASTCALL. |
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: