File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -534,7 +534,7 @@ class`. In addition, it provides a few more methods:
534534
535535 The *signed * argument determines whether two's complement is used to
536536 represent the integer. If *signed * is ``False `` and a negative integer is
537- given, an :exc: `OverflowError ` is raised. The default value for *signed *
537+ given, a :exc: `ValueError ` is raised. The default value for *signed *
538538 is ``False ``.
539539
540540 The default values can be used to conveniently turn an integer into a
@@ -559,8 +559,14 @@ class`. In addition, it provides a few more methods:
559559 return bytes((n >> i*8) & 0xff for i in order)
560560
561561 .. versionadded :: 3.2
562+
562563 .. versionchanged :: 3.11
563- Added default argument values for ``length `` and ``byteorder ``.
564+ Added default argument values for *length * and *byteorder *.
565+
566+ .. versionchanged :: next
567+ Raise :exc: `ValueError ` instead of :exc: `OverflowError ` for
568+ negative integer if *signed * is false.
569+
564570
565571.. classmethod :: int.from_bytes(bytes, byteorder='big', *, signed=False)
566572
You can’t perform that action at this time.
0 commit comments