Message395688
As for randbool() I concur with Steven. It is too trivial and in most case you do not even need to call bool().
Alternate methods:
choice((False, True))
random() < 0.5
They are less efficient than getrandbits(1), but can be easily extended to non-binary output or non-uniform distribution. |
|
Date |
User |
Action |
Args |
2021-06-12 13:45:02 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, mark.dickinson, steven.daprano, corona10 |
2021-06-12 13:45:02 | serhiy.storchaka | set | messageid: <1623505502.88.0.150413598834.issue44400@roundup.psfhosted.org> |
2021-06-12 13:45:02 | serhiy.storchaka | link | issue44400 messages |
2021-06-12 13:45:02 | serhiy.storchaka | create | |
|