New submission from Paul Crowley <pyt...@paul.ciphergoth.org>:
random.sample currently uses either a Fisher-Yates shuffle, or rejection sampling, to achieve sampling without replacement. I propose using reservoir sampling or "cardchoose"; these are similar performance or sometimes faster, and don't need to allocate anything except the list used for the results. ---------- components: Library (Lib) messages: 328728 nosy: ciphergoth priority: normal severity: normal status: open title: Improved algorithms for random.sample type: resource usage versions: Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35094> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com