Steven Basart added the comment: Re-implemented with suggested improvements taken into account. Thanks @mark.dickinson and @pitrou for the suggestions.
I also removed the redundant "fast path" portion for this code since it doesn't deal with generators anyways. Let me know additional thoughts about it. ---------- Added file: http://bugs.python.org/file42392/weighted_choice_v5.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18844> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com