8000 extmod/modubinascii: Update code, docs for hexlify now CPython has sep. · mbtronics/micropython@1719459 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1719459

Browse files
committed
extmod/modubinascii: Update code, docs for hexlify now CPython has sep.
Since CPython 3.8 the optional 8000 "sep" argument to hexlify is officially supported, so update comments in the code and the docs to reflect this. Signed-off-by: Damien George <damien@micropython.org>
1 parent 246b2e0 commit 1719459

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

docs/library/ubinascii.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ Functions
1414

1515
.. function:: hexlify(data, [sep])
1616

17-
Convert binary data to hexadecimal representation. Returns bytes string.
18-
19-
.. admonition:: Difference to CPython
20-
:class: attention
17+
Convert the bytes in the *data* object to a hexadecimal representation.
18+
Returns a bytes object.
2119

22-
If additional argument, *sep* is supplied, it is used as a separator
23-
between hexadecimal values.
20+
If the additional argument *sep* is supplied it is used as a separator
21+
between hexadecimal values.
2422

2523
.. function:: unhexlify(data)
2624

extmod/modubinascii.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
#if MICROPY_PY_UBINASCII
3535

3636
STATIC mp_obj_t mod_binascii_hexlify(size_t n_args, const mp_obj_t *args) {
37-
// Second argument is for an extension to allow a separator to be used
38-
// between values.
37+
// First argument is the data to convert.
38+
// Second argument is an optional separator to be used between values.
3939
const char *sep = NULL;
4040
mp_buffer_info_t bufinfo;
4141
mp_get_buffer_raise(args[0], &bufinfo, MP_BUFFER_READ);

0 commit comments

Comments
 (0)
0