bpo-30561: Sync-up expovariate() and gammavariate code#1934
Conversation
|
@leodema, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rhettinger, @tim-one and @tiran to be potential reviewers. |
|
I merged master in to resolve conflicts. The code change in random.py LGTM. It looks as though this needs a corresponding change in a test that's checking for specific outputs. Note that this change affects reproducibility, which is within the parameters of the promise given in the docs ("Most of the random module’s algorithms and seeding functions are subject to change across Python versions"), but we probably shouldn't break it gratuitously by backporting this change. |
|
thanks @mdickinson for merging, sorry yesterday was late night and I went to sleep, I am now working on fixing the test. I agree that backporting it will cause a lot of problems. |
|
Hi @mdickinson I fixed the test, as I was there I've split it in three different tests and I've added a test to check if the result of gammavariate with alpha=1 is equal to expovariate(1/beta) |
|
Hi @rhettinger Here I've implemented what you propose for gammavariate and fixed some tests |
https://bugs.python.org/issue30561