Move around example in to_bytes() to avoid confusion (GH-101595)
Moves an example to be closer to the sentence that refers to it.
(cherry picked from commit
5da379ca7dff44b321450800252be01041b3320b)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
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):