]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Move around example in to_bytes() to avoid confusion (#101595)
authorSergey B Kirpichev <skirpichev@gmail.com>
Sun, 5 Mar 2023 09:31:56 +0000 (12:31 +0300)
committerGitHub <noreply@github.com>
Sun, 5 Mar 2023 09:31:56 +0000 (09:31 +0000)
Moves an example to be closer to the sentence that refers to it.

Doc/library/stdtypes.rst

index 1240f80b0f11f022742160ab3a894236baea2c93..550f808a16dfaae3d7c9adf0dc5ff34f3f6f35d1 100644 (file)
@@ -530,12 +530,14 @@ class`. In addition, it provides a few more methods:
     is ``False``.
 
     The default values can be used to conveniently turn an integer into a
-    single byte object.  However, when using the default arguments, don't try
-    to convert a value greater than 255 or you'll get an :exc:`OverflowError`::
+    single byte object::
 
         >>> (65).to_bytes()
         b'A'
 
+    However, when using the default arguments, don't try
+    to convert a value greater than 255 or you'll get an :exc:`OverflowError`.
+
     Equivalent to::
 
         def to_bytes(n, length=1, byteorder='big', signed=False):