Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:
> When zero weights are given, the last element of a sequence > is always chosen. Given non-sensical input, that behavior is as reasonable as any other (fwiw, the same is also observed with all negative weights, even if the negative weights are unequal). The documentation currently says, "weights are assumed to be non-negative." Perhaps it should say, "weights are assumed to be non-negative and have at least one positive weight." ---------- assignee: -> rhettinger components: +Documentation -Library (Lib) versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38881> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com