mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-45155: Apply new byteorder default values for int.to/from_bytes (GH-28465)
This commit is contained in:
parent
5846c9b71e
commit
9510e6f3c7
5 changed files with 15 additions and 15 deletions
|
|
@ -186,7 +186,7 @@ class UUID:
|
|||
if len(bytes) != 16:
|
||||
raise ValueError('bytes is not a 16-char string')
|
||||
assert isinstance(bytes, bytes_), repr(bytes)
|
||||
int = int_.from_bytes(bytes, byteorder='big')
|
||||
int = int_.from_bytes(bytes) # big endian
|
||||
if fields is not None:
|
||||
if len(fields) != 6:
|
||||
raise ValueError('fields is not a 6-tuple')
|
||||
|
|
@ -284,7 +284,7 @@ class UUID:
|
|||
|
||||
@property
|
||||
def bytes(self):
|
||||
return self.int.to_bytes(16, 'big')
|
||||
return self.int.to_bytes(16) # big endian
|
||||
|
||||
@property
|
||||
def bytes_le(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue