Skip to content

Doc: sys.__unraisablehook__ and bytearray.hex separators are new in 3.8 #17884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2416,7 +2416,7 @@ data and are closely related to string objects in a variety of other ways.
A reverse conversion function exists to transform a bytes object into its
hexadecimal representation.

.. method:: hex()
.. method:: hex([sep[, bytes_per_sep]])

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

.. method:: hex()
.. method:: hex([sep[, bytes_per_sep]])

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

.. versionadded:: 3.5

.. versionchanged:: 3.8
Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports
optional *sep* and *bytes_per_sep* parameters to insert separators
between bytes in the hex output.

Since bytearray objects are sequences of integers (akin to a list), for a
bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be
a bytearray object of length 1. (This contrasts with text strings, where
Expand Down Expand Up @@ -3673,7 +3678,7 @@ copying.
in-memory Fortran order is preserved. For non-contiguous views, the
data is converted to C first. *order=None* is the same as *order='C'*.

.. method:: hex()
.. method:: hex([sep[, bytes_per_sep]])

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

.. versionadded:: 3.5

.. versionchanged:: 3.8
Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports
optional *sep* and *bytes_per_sep* parameters to insert separators
between bytes in the hex output.

.. method:: tolist()

Return the data in the buffer as a list of elements. ::
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ always available.
.. versionadded:: 3.7
__breakpointhook__

.. versionadded:: 3.8
__unraisablehook__

.. function:: exc_info()

Expand Down