[issue21394] Lib/random.py: use more efficient code to convert bytes to integer

2014-04-30 Thread STINNER Victor
STINNER Victor added the comment: Oops, I didn't read the right version of the code. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ __

[issue21394] Lib/random.py: use more efficient code to convert bytes to integer

2014-04-30 Thread Claudiu.Popa
Claudiu.Popa added the comment: Do you mean int.from_bytes? It's already changed in Python 3.5: int.from_bytes(_urandom(32), 'big'). -- nosy: +Claudiu.Popa ___ Python tracker __

[issue21394] Lib/random.py: use more efficient code to convert bytes to integer

2014-04-30 Thread STINNER Victor
New submission from STINNER Victor: In Lib/random.py, I see lines like that: long(_hexlify(_urandom(32)), 16) I guess that something more efficient can be fonud to convert a bytes string to an integer. bytes.from_bytes() maybe? -- keywords: easy messages: 217595 nosy: haypo priori