Issue #20179: Apply Argument Clinic to bytes and bytearray.

Patch by Tal Einat.
This commit is contained in:
Martin v. Löwis 2014-07-27 16:25:09 +02:00
parent e1b82531b3
commit 7252a6e81e
5 changed files with 1876 additions and 563 deletions

View File

@ -21,8 +21,8 @@ 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_capitalize(char *result, char *s, Py_ssize_t len);
extern void _Py_bytes_swapcase(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. */ /* The maketrans() static method. */
extern PyObject* _Py_bytes_maketrans(PyObject *args); extern PyObject* _Py_bytes_maketrans(PyObject *frm, PyObject *to);
/* Shared __doc__ strings. */ /* Shared __doc__ strings. */
extern const char _Py_isspace__doc__[]; extern const char _Py_isspace__doc__[];

View File

@ -10,6 +10,9 @@ Release date: TBA
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #20179: Apply Argument Clinic to bytes and bytearray.
Patch by Tal Einat.
- Issue #22082: Clear interned strings in slotdefs. - Issue #22082: Clear interned strings in slotdefs.
- Upgrade Unicode database to Unicode 7.0.0. - Upgrade Unicode database to Unicode 7.0.0.

File diff suppressed because it is too large Load Diff

View File

@ -382,9 +382,9 @@ _getbuffer(PyObject *obj, Py_buffer *view)
} }
PyObject * PyObject *
_Py_bytes_maketrans(PyObject *args) _Py_bytes_maketrans(PyObject *frm, PyObject *to)
{ {
PyObject *frm, *to, *res = NULL; PyObject *res = NULL;
Py_buffer bfrm, bto; Py_buffer bfrm, bto;
Py_ssize_t i; Py_ssize_t i;
char *p; char *p;
@ -392,8 +392,6 @@ _Py_bytes_maketrans(PyObject *args)
bfrm.len = -1; bfrm.len = -1;
bto.len = -1; bto.len = -1;
if (!PyArg_ParseTuple(args, "OO:maketrans", &frm, &to))
return NULL;
if (_getbuffer(frm, &bfrm) < 0) if (_getbuffer(frm, &bfrm) < 0)
return NULL; return NULL;
if (_getbuffer(to, &bto) < 0) if (_getbuffer(to, &bto) < 0)

File diff suppressed because it is too large Load Diff