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

STINNER Victor report at bugs.python.org
Wed Apr 30 12:07:47 CEST 2014


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 <report at bugs.python.org>
<http://bugs.python.org/issue21394>
_______________________________________


More information about the Python-bugs-list mailing list