[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
priority: normal
severity: normal
status: open
title: Lib/random.py: use more efficient code to convert bytes to integer
type: performance
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com