Alexandre Vassalotti added the comment: is the buggy one here. Its use of the marshal module is really a 
hack. Plus, it is slower than both struct and int.from_bytes.

14:40:57 [~/cpython]$ ./python -m timeit "int.from_bytes(b'\xff\xff\xff\xff', 
1000000 loops, best of 3: 0.209 usec per loop
14:38:03 [~/cpython]$ ./python -m timeit -s "import struct" 
"struct.unpack('>I', b'\xff\xff\xff\xff')"
10000000 loops, best of 3: 0.147 usec per loop
14:37:44 [~/cpython]$ ./python -m timeit -s "import marshal" 
1000000 loops, best of 3: 0.236 usec per loop


Python tracker <>
Python-bugs-list mailing list

Reply via email to