[issue34227] Weighted random.sample() (weighted sampling without replacement)

2018-07-25 Thread Piotr Jurkiewicz
Change by Piotr Jurkiewicz : -- keywords: +patch pull_requests: +7988 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34227> ___ _

[issue34227] Weighted random.sample() (weighted sampling without replacement)

2018-07-25 Thread Piotr Jurkiewicz
New submission from Piotr Jurkiewicz : Function random.choices(), which appeared in Python 3.6, allows to perform weighted random sampling with replacement. Function random.sample() performs random sampling without replacement, but cannot do it weighted. I propose to enhance random.sample

[issue23351] socket.settimeout(5.0) does not have any effect

2015-02-04 Thread Piotr Jurkiewicz
Piotr Jurkiewicz added the comment: Does not work on Debian 7 Wheezy, kernel 3.2.65. $ python test.py ('sending ', 0) took 0.000s ('sending ', 1) took 0.000s ('sending ', 2) took 0.000s ('sending ', 3) took 0.000s ('sending ', 4) took 0.000

[issue23351] socket.settimeout(5.0) does not have any effect

2015-01-29 Thread Piotr Jurkiewicz
New submission from Piotr Jurkiewicz: After setting socket.settimeout(5.0), socket.send() returns immediately, instead of returning after specified timeout. Steps to reproduce: Open two python interpreters. In the first one (the receiver) execute: >>> import socket >>>