• Guido van Rossum's avatar
    Introducing randrange([start,] stop [,step]) -- same as · 187f1542
    Guido van Rossum yazdı
    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()
    :-)
    187f1542
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
Tools Loading commit data...
.hgtags Loading commit data...
Makefile.in Loading commit data...
README Loading commit data...
acconfig.h Loading commit data...
config.h.in Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...