summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>2025-01-03 12:37:02 (GMT)
committerGitHub <noreply@github.com>2025-01-03 12:37:02 (GMT)
commitfa985bee6189aabac1c329f2de32aa9a4e88e550 (patch)
treef8cff7de53a0a5f7cd79f6ef0d5d18be8c22fbdc /Doc/library
parent8abd6cef68a0582a4d912be76caddd9da5d55ccd (diff)
downloadcpython-fa985bee6189aabac1c329f2de32aa9a4e88e550.zip
cpython-fa985bee6189aabac1c329f2de32aa9a4e88e550.tar.gz
cpython-fa985bee6189aabac1c329f2de32aa9a4e88e550.tar.bz2
gh-127787: refactor helpers for `PyUnicodeErrorObject` internal interface (GH-127789)
- Unify `get_unicode` and `get_string` in a single function. - Allow to retrieve the underlying `object` attribute, its size, and the adjusted 'start' and 'end', all at once. Add a new `_PyUnicodeError_GetParams` internal function for this. (In `exceptions.c`, it's somewhat common to not need all the attributes, but the compiler has opportunity to inline the function and optimize unneeded work away. Outside that file, we'll usually need all or most of them at once.) - Use a common implementation for the following functions: - `PyUnicode{Decode,Encode}Error_GetEncoding` - `PyUnicode{Decode,Encode,Translate}Error_GetObject` - `PyUnicode{Decode,Encode,Translate}Error_{Get,Set}Reason` - `PyUnicode{Decode,Encode,Translate}Error_{Get,Set}{Start,End}`
Diffstat (limited to 'Doc/library')
0 files changed, 0 insertions, 0 deletions