summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2013-04-13 15:04:19 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2013-04-13 15:04:19 (GMT)
commit44e33f39bf6268e8cf6dc807ea6c0f50d30919f9 (patch)
tree3fa1b3855d2269e98d437dcc0ba4844cbfebb727 /Lib/random.py
parent556e94b8fe068d1d58064fe84467e0620b87f9ed (diff)
parentb4fd468f125955b14f53e77e1f29b216ca888c88 (diff)
downloadcpython-44e33f39bf6268e8cf6dc807ea6c0f50d30919f9.zip
cpython-44e33f39bf6268e8cf6dc807ea6c0f50d30919f9.tar.gz
cpython-44e33f39bf6268e8cf6dc807ea6c0f50d30919f9.tar.bz2
Revert changes for #13355 by request from Raymond Hettinger
Diffstat (limited to 'Lib/random.py')
-rw-r--r--Lib/random.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/Lib/random.py b/Lib/random.py
index 2fa9887..b183f56 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -345,16 +345,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: