Message99157
Thank you for all the help! I'm glad to see that the use of hash() on buffer compatible objects is an actual gotcha and not just me being obtuse.
Also, for those googling who, like me, won't be able to use 3.2's from_bytes until 3.2 is released in December, here is code to convert a bytes to an int:
>>> n = 0
>>> off = 0
>>> data = b'\xfc\x00'
>>> for c in data[::-1]:
... n += c << off
... off += 8
...
>>> print(n)
64512
Or, if you prefer the functional style:
>>> sum([c<<off for c,off in zip(data[::-1],range(0,len(data)*8+1,8))])
64512 |
|
Date |
User |
Action |
Args |
2010-02-10 07:53:20 | terrence | set | recipients:
+ terrence, loewis, rhettinger, mark.dickinson, pitrou, michael.foord |
2010-02-10 07:53:19 | terrence | set | messageid: <1265788399.85.0.0952737592611.issue7889@psf.upfronthosting.co.za> |
2010-02-10 07:53:18 | terrence | link | issue7889 messages |
2010-02-10 07:53:17 | terrence | create | |
|