[New-bugs-announce] [issue35980] Py3 BIF random.choices() is O(N**2) but I've written O(N) code for the same task

shawnberry report at bugs.python.org
Tue Feb 12 20:08:44 EST 2019


New submission from shawnberry <shawnberry121 at gmail.com>:

Please see my GitHub page https://github.com/shawnberry/Improved_random.choices/blob/master/Improved_Py3_BIF_random_dot_choices.py
for code that reduces Py3 BIF random.choices() from O(N**2) to O(N).
This is my first suggestion to improve Python code.
Thanks,
shawnberry121 at gmail.com

----------
components: Library (Lib)
files: Improved_Py3_BIF_random_dot_choices.py
hgrepos: 380
messages: 335379
nosy: shawn_berry
priority: normal
severity: normal
status: open
title: Py3 BIF random.choices() is O(N**2) but I've written O(N) code for the same task
type: performance
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48135/Improved_Py3_BIF_random_dot_choices.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35980>
_______________________________________


More information about the New-bugs-announce mailing list