Skip to content

Commit 5fdb64b

Browse files
committed
#19411: Clarify that b2a_hex/hexlify returns a bytes object.
Initial patch by Vajrasky Kok.
1 parent 0de4d3e commit 5fdb64b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Doc/library/binascii.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ The :mod:`binascii` module defines the following functions:
145145

146146
Return the hexadecimal representation of the binary *data*. Every byte of
147147
*data* is converted into the corresponding 2-digit hex representation. The
148-
resulting string is therefore twice as long as the length of *data*.
148+
returned bytes object is therefore twice as long as the length of *data*.
149149

150150

151151
.. function:: a2b_hex(hexstr)

Modules/binascii.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,8 @@ binascii_hexlify(PyObject *self, PyObject *args)
11291129
PyDoc_STRVAR(doc_hexlify,
11301130
"b2a_hex(data) -> s; Hexadecimal representation of binary data.\n\
11311131
\n\
1132-
This function is also available as \"hexlify()\".");
1132+
The return value is a bytes object. This function is also\n\
1133+
available as \"hexlify()\".");
11331134

11341135

11351136
static int

0 commit comments

Comments
 (0)