Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44400>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to