4 ms·
I tried... $ python3 >>> # not using os.urandom to save a import... >>> rng = open("/dev/urandom", "rb") >>> "{0:08b}".format(rng.read(1)[0])
by bcaa7f3a8bbc 8y ago
I tried...
$ python3
>>> # not using os.urandom to save a import...
>>> rng = open("/dev/urandom", "rb")
>>> "{0:08b}".format(rng.read(1)[0])
And act accordingly, soon the correct rate approaches 50% as expected.
- onlydeadheroes 8y agoPaying for each import was the worst design decision in Python!
- chongli 8y agoWhat do you mean by this? I'm not a Python expert by any means.
- Gene_Parmesan 8y agoIt's a joke.
- boomlinde 8y agoI think it was a jocular jab aimed at the idea of "saving an import" and documenting that choice with a comment that's longer than the module import would have been.