This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Anton Tagunov
Recipients Anton Tagunov, docs@python
Date 2015-10-27.13:52:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1445953930.63.0.811107354907.issue25490@psf.upfronthosting.co.za>
In-reply-to
Content
Invalid example at this page: https://docs.python.org/3.6/library/random.html

'.items()' is missed in the line below:

>>> population = [val for val, cnt in weighted_choices for i in range(cnt)]


The correct variant:

>>> population = [val for val, cnt in weighted_choices.items() for i in range(cnt)]
History
Date User Action Args
2015-10-27 13:52:10Anton Tagunovsetrecipients: + Anton Tagunov, docs@python
2015-10-27 13:52:10Anton Tagunovsetmessageid: <1445953930.63.0.811107354907.issue25490@psf.upfronthosting.co.za>
2015-10-27 13:52:10Anton Tagunovlinkissue25490 messages
2015-10-27 13:52:10Anton Tagunovcreate