diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-05 20:26:10 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-05 20:26:10 (GMT) |
commit | 92bf919ed0da8d7f112f9659e6065976e382bae1 (patch) | |
tree | 1876e54c89f619563d8b4218bb7fa5f05eb86b0a /Python/getargs.c | |
parent | 1a7b8d143965c281467379123187e0ef323380c3 (diff) | |
parent | b757c83ec626442a8804b9417790443bf13b4fc8 (diff) | |
download | cpython-92bf919ed0da8d7f112f9659e6065976e382bae1.zip cpython-92bf919ed0da8d7f112f9659e6065976e382bae1.tar.gz cpython-92bf919ed0da8d7f112f9659e6065976e382bae1.tar.bz2 |
Issue #22581: Use more "bytes-like object" throughout the docs and comments.
Diffstat (limited to 'Python/getargs.c')
-rw-r--r-- | Python/getargs.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index f7297da..f0f8e39 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -849,7 +849,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, /* XXX WAAAAH! 's', 'y', 'z', 'u', 'Z', 'e', 'w' codes all need to be cleaned up! */ - case 'y': {/* any buffer-like object, but not PyUnicode */ + case 'y': {/* any bytes-like object */ void **p = (void **)va_arg(*p_va, char **); char *buf; Py_ssize_t count; @@ -880,8 +880,8 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, break; } - case 's': /* text string */ - case 'z': /* text string or None */ + case 's': /* text string or bytes-like object */ + case 'z': /* text string, bytes-like object or None */ { if (*format == '*') { /* "s*" or "z*" */ @@ -897,7 +897,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, arg, msgbuf, bufsize); PyBuffer_FillInfo(p, arg, sarg, len, 1, 0); } - else { /* any buffer-like object */ + else { /* any bytes-like object */ char *buf; if (getbuffer(arg, p, &buf) < 0) return converterr(buf, arg, msgbuf, bufsize); @@ -908,7 +908,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, arg, msgbuf, bufsize); } format++; - } else if (*format == '#') { /* any buffer-like object */ + } else if (*format == '#') { /* a string or read-only bytes-like object */ /* "s#" or "z#" */ void **p = (void **)va_arg(*p_va, char **); FETCH_SIZE; @@ -926,7 +926,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, *p = sarg; STORE_SIZE(len); } - else { /* any buffer-like object */ + else { /* read-only bytes-like object */ /* XXX Really? */ char *buf; Py_ssize_t count = convertbuffer(arg, p, &buf); @@ -966,7 +966,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, { Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **); - if (*format == '#') { /* any buffer-like object */ + if (*format == '#') { /* "s#" or "Z#" */ FETCH_SIZE; |