summaryrefslogtreecommitdiff
path: root/Python/modsupport.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-07-31 13:39:44 +0000
committerGuido van Rossum <guido@python.org>1998-07-31 13:39:44 +0000
commit187f154243eb43b2d81f9b253458a16880e1b0bb (patch)
treeadcd2fcabffd96c3d7942469c1a3ff8497b42b52 /Python/modsupport.c
parent490ec9c8773fd117cb724522b94eaac8e03932ef (diff)
downloadcpython-git-187f154243eb43b2d81f9b253458a16880e1b0bb.tar.gz
Introducing randrange([start,] stop [,step]) -- same as
choice(range(start, stop, step)) but faster. This addresses the problem that randint() was accidentally defined as taking an inclusive range (how unpythonic). The code is longish because Tim Peters insisted that it reject non-integral arguments while I insisted that it be not much slower than randint(); the compromise satisfies both but is somewhat convoluted. Also changed randint() to be implemented through randrange(). This is a semantic change because old randint() didn't test its arguments for validity. (It also makes randrange() win any contest with randint() :-)
Diffstat (limited to 'Python/modsupport.c')
0 files changed, 0 insertions, 0 deletions