Message395671
I noticed that the random library does not provide `random.randbool()`.
Generating bool value is quite common in the use-case when we generated faked data
(unittest, machine learning training, etc)
Somebody can say write your own library but it's too common use-case and in physically some isolated environments is hard to use 3rd party library.
Since the bool value is the built-in type of python, I think that is very useful when we provide this function.
I would like to get opinions from Raymond and then proceed with this issue.
Here is the candidate implementation:
def randbool():
return bool(getrandbits(1)) |
|
Date |
User |
Action |
Args |
2021-06-12 00:33:48 | corona10 | set | recipients:
+ corona10, rhettinger |
2021-06-12 00:33:48 | corona10 | set | messageid: <1623458028.32.0.0235692226246.issue44400@roundup.psfhosted.org> |
2021-06-12 00:33:48 | corona10 | link | issue44400 messages |
2021-06-12 00:33:47 | corona10 | create | |
|