[issue25490] small mistake in example for random.choice()

2015-10-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is no mistake. weighted_choices is a list of pairs. -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker _

[issue25490] small mistake in example for random.choice()

2015-10-27 Thread Anton Tagunov
New submission from Anton Tagunov: 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 weig