diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-08-27 08:35:02 +0000 |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-08-27 08:35:02 +0000 |
commit | 1b6c6da85d7fd268825e09cc8ff339540c1f77bc (patch) | |
tree | c714a20ce1553644c721170044e55a43ee8a676b /Objects/bytesobject.c | |
parent | 8c3c52b19f6ded5593cfab1086051cb5f4628434 (diff) | |
download | cpython-git-1b6c6da85d7fd268825e09cc8ff339540c1f77bc.tar.gz |
Issue #27506: Support bytes/bytearray.translate() delete as keyword argument
Patch by Xiang Zhang.
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r-- | Objects/bytesobject.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index ff87dfe775..4fdaa526a6 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2045,21 +2045,19 @@ bytes.translate table: object Translation table, which must be a bytes object of length 256. - [ - deletechars: object - ] / + delete as deletechars: object(c_default="NULL") = b'' Return a copy with each character mapped by the given translation table. -All characters occurring in the optional argument deletechars are removed. +All characters occurring in the optional argument delete are removed. The remaining characters are mapped through the given translation table. [clinic start generated code]*/ static PyObject * -bytes_translate_impl(PyBytesObject *self, PyObject *table, int group_right_1, +bytes_translate_impl(PyBytesObject *self, PyObject *table, PyObject *deletechars) -/*[clinic end generated code: output=233df850eb50bf8d input=ca20edf39d780d49]*/ +/*[clinic end generated code: output=43be3437f1956211 input=0ecdf159f654233c]*/ { char *input, *output; Py_buffer table_view = {NULL, NULL}; |