mirror of
https://github.com/python/cpython
synced 2026-09-29 09:55:31 +03:00
Add bytes/bytearray.maketrans() to mirror str.maketrans(), and deprecate
string.maketrans() which actually works on bytes. (Also closes #5675.)
This commit is contained in:
parent
78532baeab
commit
abc387747d
11 changed files with 134 additions and 32 deletions
|
|
@ -20,6 +20,9 @@ extern void _Py_bytes_title(char *result, char *s, Py_ssize_t len);
|
|||
extern void _Py_bytes_capitalize(char *result, char *s, Py_ssize_t len);
|
||||
extern void _Py_bytes_swapcase(char *result, char *s, Py_ssize_t len);
|
||||
|
||||
/* This one gets the raw argument list. */
|
||||
extern PyObject* _Py_bytes_maketrans(PyObject *args);
|
||||
|
||||
/* Shared __doc__ strings. */
|
||||
extern const char _Py_isspace__doc__[];
|
||||
extern const char _Py_isalpha__doc__[];
|
||||
|
|
@ -33,6 +36,7 @@ extern const char _Py_upper__doc__[];
|
|||
extern const char _Py_title__doc__[];
|
||||
extern const char _Py_capitalize__doc__[];
|
||||
extern const char _Py_swapcase__doc__[];
|
||||
extern const char _Py_maketrans__doc__[];
|
||||
|
||||
#define FLAG_LOWER 0x01
|
||||
#define FLAG_UPPER 0x02
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue