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:
Georg Brandl 2009-04-12 15:51:51 +00:00
parent 78532baeab
commit abc387747d
11 changed files with 134 additions and 32 deletions

View file

@ -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