Sorry, something went wrong.
|
Script to demonstrate the improvement: from random import random
from itertools import permutations
n = 4
trials = 100
errors = 0
for i in range(trials):
example = [random() for i in range(n)]
if len(set(map(sum, permutations(example)))) != 1:
errors += 1
print(i, sorted(example))
print(f'{errors / trials * 100.0=}%')
Formerly there was a 63% error rate. Now it is zero. |
Sorry, something went wrong.
|
Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
|
GH-107787 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
📚 Documentation preview 📚: https://cpython-previews--107785.org.readthedocs.build/