@@ -2399,7 +2399,7 @@ data and are closely related to string objects in a variety of other ways.
23992399 A reverse conversion function exists to transform a bytes object into its
24002400 hexadecimal representation.
24012401
2402- .. method :: hex()
2402+ .. method :: hex([sep[, bytes_per_sep]] )
24032403
24042404 Return a string object containing two hexadecimal digits for each
24052405 byte in the instance.
@@ -2493,7 +2493,7 @@ objects.
24932493 A reverse conversion function exists to transform a bytearray object into its
24942494 hexadecimal representation.
24952495
2496- .. method :: hex()
2496+ .. method :: hex([sep[, bytes_per_sep]] )
24972497
24982498 Return a string object containing two hexadecimal digits for each
24992499 byte in the instance.
@@ -2503,6 +2503,11 @@ objects.
25032503
25042504 .. versionadded :: 3.5
25052505
2506+ .. versionchanged :: 3.8
2507+ Similar to :meth: `bytes.hex `, :meth: `bytearray.hex ` now supports
2508+ optional *sep * and *bytes_per_sep * parameters to insert separators
2509+ between bytes in the hex output.
2510+
25062511Since bytearray objects are sequences of integers (akin to a list), for a
25072512bytearray object *b *, ``b[0] `` will be an integer, while ``b[0:1] `` will be
25082513a bytearray object of length 1. (This contrasts with text strings, where
@@ -3649,7 +3654,7 @@ copying.
36493654 in-memory Fortran order is preserved. For non-contiguous views, the
36503655 data is converted to C first. *order=None * is the same as *order='C' *.
36513656
3652- .. method :: hex()
3657+ .. method :: hex([sep[, bytes_per_sep]] )
36533658
36543659 Return a string object containing two hexadecimal digits for each
36553660 byte in the buffer. ::
@@ -3660,6 +3665,11 @@ copying.
36603665
36613666 .. versionadded :: 3.5
36623667
3668+ .. versionchanged :: 3.8
3669+ Similar to :meth: `bytes.hex `, :meth: `memoryview.hex ` now supports
3670+ optional *sep * and *bytes_per_sep * parameters to insert separators
3671+ between bytes in the hex output.
3672+
36633673 .. method :: tolist()
36643674
36653675 Return the data in the buffer as a list of elements. ::
0 commit comments