-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-129173: simplify PyCodec_XMLCharRefReplaceErrors
logic
#129894
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-129173: simplify PyCodec_XMLCharRefReplaceErrors
logic
#129894
Conversation
Huh, I probably messed up my index somewhere. Will fix it later or tomorrow. |
xmlcharrefreplace
handler.xmlcharrefreplace
handler
…refreplace-handler-129173
…refreplace-handler-129173
I filed my suggestion as https://github.com/picnixz/cpython/pull/1/files |
…ler-129173 cpython#129894: just get the log10
I've applied your suggestion and tweaked it a bit. By the way, I observe that I forgot to remove a "object is ready" comment. Do you mind that after this PR and the following one for backslashreplace, I skim through the code base to remove the un-necessary related comments? there are a few occurrences of saying that some Unicode object is "ready" |
That's a style change, which we generally only do when touching neighboring code. How many are there? I'd need to review each of those removals in context. |
Apart from those already in codecs.c that I forgot to remove, not many: Lines 594 to 596 in a85eeb9
Lines 655 to 661 in a85eeb9
Lines 357 to 363 in a85eeb9
Lines 1821 to 1824 in a85eeb9
Lines 311 to 315 in a85eeb9
Lines 505 to 513 in a85eeb9
Lines 252 to 259 in a85eeb9
The |
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.
Thanks!
You might want to split the comment removals to 5 PRs (each to be seen by different subject experts), and combine them with removing the remaining calls to Careful, the one in |
Oups, you're right. |
xmlcharrefreplace
handlerPyCodec_XMLCharRefReplaceErrors
logic
I really want to be able to preview the commit message when I'm enabling auto-merge... |
…thon#129894) Writing the decimal representation of a Unicode codepoint only requires to know the number of digits. --------- Co-authored-by: Petr Viktorin <[email protected]>
_PyUnicodeError_GetParams
and extract complex logic into separate functions #129173