diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2013-04-13 15:00:04 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2013-04-13 15:00:04 (GMT) |
commit | b4fd468f125955b14f53e77e1f29b216ca888c88 (patch) | |
tree | 7c640692ea514f6c5c067a3eadc5fdcf05dc5bf4 /Lib/random.py | |
parent | 64aafeb4de3b5e85007f2107250e6f1da4df2516 (diff) | |
download | cpython-b4fd468f125955b14f53e77e1f29b216ca888c88.zip cpython-b4fd468f125955b14f53e77e1f29b216ca888c88.tar.gz cpython-b4fd468f125955b14f53e77e1f29b216ca888c88.tar.bz2 |
Revert changes for #13355 by request from Raymond Hettinger
Diffstat (limited to 'Lib/random.py')
-rw-r--r-- | Lib/random.py | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/Lib/random.py b/Lib/random.py index 11a0606..7d8d4f3 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -341,16 +341,6 @@ class Random(_random.Random): http://en.wikipedia.org/wiki/Triangular_distribution """ - # Sanity check. According to the doc low must be less or equal to - # high. And mode should be somewhere between these bounds. - if low > high: - raise ValueError('high cannot be less then low.') - if mode is not None and (mode < low or mode > high): - raise ValueError('mode must be between low and high.') - - if high == low: - return low - u = self.random() c = 0.5 if mode is None else (mode - low) / (high - low) if u > c: |