[Python-checkins] Doc: sys.__unraisablehook__ and bytearray.hex separators are new in 3.8 (GH-17884)

Miss Islington (bot) webhook-mailer at python.org
Fri Feb 7 19:54:10 EST 2020


https://github.com/python/cpython/commit/0c915e620d049558bacc78cf25c1560f55d1fb82
commit: 0c915e620d049558bacc78cf25c1560f55d1fb82
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-02-07T16:54:06-08:00
summary:

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`)
(cherry picked from commit 0edc2c7678266c39a7ceb2df885cb050f887e32b)

Co-authored-by: Saiyang Gou <gousaiyang at 163.com>

files:
M Doc/library/stdtypes.rst
M Doc/library/sys.rst

diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index d6db9b5411d8a..d369b38b31bc9 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -2399,7 +2399,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.
@@ -2493,7 +2493,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.
@@ -2503,6 +2503,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
@@ -3649,7 +3654,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. ::
@@ -3660,6 +3665,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. ::
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index e1d93f85bd407..d3473de1292ea 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -343,6 +343,8 @@ always available.
    .. versionadded:: 3.7
       __breakpointhook__
 
+   .. versionadded:: 3.8
+      __unraisablehook__
 
 .. function:: exc_info()
 



More information about the Python-checkins mailing list