diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-05 20:25:22 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-05 20:25:22 (GMT) |
commit | b757c83ec626442a8804b9417790443bf13b4fc8 (patch) | |
tree | e9361287f1239fa9758a9387cbd7aa9096a76601 /Python | |
parent | 6b335196c50049685e5fd2dc420cbba68de489e8 (diff) | |
download | cpython-b757c83ec626442a8804b9417790443bf13b4fc8.zip cpython-b757c83ec626442a8804b9417790443bf13b4fc8.tar.gz cpython-b757c83ec626442a8804b9417790443bf13b4fc8.tar.bz2 |
Issue #22581: Use more "bytes-like object" throughout the docs and comments.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/getargs.c | 14 | ||||
-rw-r--r-- | Python/marshal.c | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 946faf2..3f47b21 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); @@ -967,7 +967,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; diff --git a/Python/marshal.c b/Python/marshal.c index dc5411c..bb5faf3 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -529,7 +529,7 @@ w_complex_object(PyObject *v, char flag, WFILE *p) w_object(co->co_lnotab, p); } else if (PyObject_CheckBuffer(v)) { - /* Write unknown buffer-style objects as a string */ + /* Write unknown bytes-like objects as a byte string */ Py_buffer view; if (PyObject_GetBuffer(v, &view, PyBUF_SIMPLE) != 0) { w_byte(TYPE_UNKNOWN, p); |