Skip to content

Commit 0edc2c7

Browse files
authored
Doc: sys.__unraisablehook__ and bytearray.hex separators are new in 3.8 (GH-17884)
Minor fix in documentation: - `sys.__unraisablehook__` is new in version 3.8 - Optional `sep` and `bytes_per_sep` parameters for `bytearray.hex` is also supported in Python 3.8 (just like `bytes.hex`)
1 parent 9a978dd commit 0edc2c7

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Doc/library/stdtypes.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,7 +2416,7 @@ data and are closely related to string objects in a variety of other ways.
24162416
A reverse conversion function exists to transform a bytes object into its
24172417
hexadecimal representation.
24182418

2419-
.. method:: hex()
2419+
.. method:: hex([sep[, bytes_per_sep]])
24202420

24212421
Return a string object containing two hexadecimal digits for each
24222422
byte in the instance.
@@ -2510,7 +2510,7 @@ objects.
25102510
A reverse conversion function exists to transform a bytearray object into its
25112511
hexadecimal representation.
25122512

2513-
.. method:: hex()
2513+
.. method:: hex([sep[, bytes_per_sep]])
25142514

25152515
Return a string object containing two hexadecimal digits for each
25162516
byte in the instance.
@@ -2520,6 +2520,11 @@ objects.
25202520

25212521
.. versionadded:: 3.5
25222522

2523+
.. versionchanged:: 3.8
2524+
Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports
2525+
optional *sep* and *bytes_per_sep* parameters to insert separators
2526+
between bytes in the hex output.
2527+
25232528
Since bytearray objects are sequences of integers (akin to a list), for a
25242529
bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be
25252530
a bytearray object of length 1. (This contrasts with text strings, where
@@ -3673,7 +3678,7 @@ copying.
36733678
in-memory Fortran order is preserved. For non-contiguous views, the
36743679
data is converted to C first. *order=None* is the same as *order='C'*.
36753680

3676-
.. method:: hex()
3681+
.. method:: hex([sep[, bytes_per_sep]])
36773682

36783683
Return a string object containing two hexadecimal digits for each
36793684
byte in the buffer. ::
@@ -3684,6 +3689,11 @@ copying.
36843689

36853690
.. versionadded:: 3.5
36863691

3692+
.. versionchanged:: 3.8
3693+
Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports
3694+
optional *sep* and *bytes_per_sep* parameters to insert separators
3695+
between bytes in the hex output.
3696+
36873697
.. method:: tolist()
36883698

36893699
Return the data in the buffer as a list of elements. ::

Doc/library/sys.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ always available.
343343
.. versionadded:: 3.7
344344
__breakpointhook__
345345

346+
.. versionadded:: 3.8
347+
__unraisablehook__
346348

347349
.. function:: exc_info()
348350

0 commit comments

Comments
 (0)