-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
bpo-43693: Group the code in codeobject.c logically. #26216
bpo-43693: Group the code in codeobject.c logically. #26216
Conversation
Can you confirm that this is a pure refactoring that doesn't change any APIs or semantics? (That's what it sounds like, but there's a lot of code in the diff...) |
Yeah, it is almost exclusively only moving code around in the file. The only 2 exceptions are the addition of |
Looks like you broke the argument clinic? |
This is almost certain to cause merge conflicts with work on PEP 657. Given that the line number table is likely to grow and change with PEP 657, how about moving that code to it's own file? |
I think having it in the same file is fine, as it will cause merge conflicts for us in any case. There is some benefit of having fewer compilation units. In the other hand maybe it will result in a better organisation of the code so if you think it makes sense I would be fine too :) |
item = PyTuple_GET_ITEM(tup, i); | ||
if (PyUnicode_CheckExact(item)) { | ||
Py_INCREF(item); | ||
static PyTypeObject LineIterator = { |
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.
Now that we are here, we could transform these initializers to C99 :)
Let's not sit on this longer. LGTM, if either Mark or Pablo approves then just land it. |
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.
Looks good for me, but @markshannon should review the function renames
At the moment the code in codeobject.c is a bit scattered around, relative to the logical grouping of the code. This PR addresses that by moving various functions (and types) into logical groups, with a comment dividing them and identifying each group. With this change, subsequent changes I'm planning on making become cleaner, which is the main motivation here.
https://bugs.python.org/issue43693