[Python-checkins] r84575 - python/branches/py3k/Lib/random.py
raymond.hettinger
python-checkins at python.org
Tue Sep 7 02:48:40 CEST 2010
Author: raymond.hettinger
Date: Tue Sep 7 02:48:40 2010
New Revision: 84575
Log:
Minor code cleanup
Modified:
python/branches/py3k/Lib/random.py
Modified: python/branches/py3k/Lib/random.py
==============================================================================
--- python/branches/py3k/Lib/random.py (original)
+++ python/branches/py3k/Lib/random.py Tue Sep 7 02:48:40 2010
@@ -161,13 +161,13 @@
## -------------------- integer methods -------------------
- def randrange(self, start, stop=None, step=1, int=int, default=None,
- maxwidth=1<<BPF):
+ def randrange(self, start, stop=None, step=1, int=int, maxwidth=1<<BPF):
"""Choose a random item from range(start, stop[, step]).
This fixes the problem with randint() which includes the
endpoint; in Python this is usually not what you want.
- Do not supply the 'int', 'default', and 'maxwidth' arguments.
+
+ Do not supply the 'int' and 'maxwidth' arguments.
"""
# This code is a bit messy to make it fast for the
@@ -175,7 +175,7 @@
istart = int(start)
if istart != start:
raise ValueError("non-integer arg 1 for randrange()")
- if stop is default:
+ if stop is None:
if istart > 0:
if istart >= maxwidth:
return self._randbelow(istart)
More information about the Python-checkins
mailing list