Message271329
As you can see, these conversions are not consistent. What is use case to allow that?
===================
In [22]: (-1).to_bytes(0, 'big', signed=True)
Out[22]: b''
In [23]: (0).to_bytes(0, 'big', signed=True)
Out[23]: b''
As you can see, two different values serialized to same empty bytes sequence.
===================
In [28]: int.from_bytes(b'', 'big', signed=True)
Out[28]: 0
In [29]: int.from_bytes(b'', 'big', signed=False)
Out[29]: 0
Anyway, -1 can not be deserialized.
=================== |
|
Date |
User |
Action |
Args |
2016-07-26 06:26:20 | socketpair | set | recipients:
+ socketpair |
2016-07-26 06:26:20 | socketpair | set | messageid: <1469514380.74.0.642597369558.issue27623@psf.upfronthosting.co.za> |
2016-07-26 06:26:20 | socketpair | link | issue27623 messages |
2016-07-26 06:26:20 | socketpair | create | |
|