This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients rhettinger, serhiy.storchaka, terry.reedy, tim.peters, veky
Date 2020-11-07.10:00:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
To me, ValueError("non-integer arg 1 for randrange()") (ValueError('bad type') is a bit painful to read.  We do sometime fix such bugs, when not documented, in future releases.

Current the doc, "Return a randomly selected element from range(start, stop, step). This is equivalent to choice(range(start, stop, step))", implies that both accept the same values, which most would expect anyway from the names.  Being selectively 'generous' in what is accepted is confusing.

For the future: both range and math.factorial raise
TypeError: 'float' object cannot be interpreted as an integer
The consistency is nice.  randrange should say the same after deprecation.
Date User Action Args
2020-11-07 10:00:59terry.reedysetrecipients: + terry.reedy, tim.peters, rhettinger, serhiy.storchaka, veky
2020-11-07 10:00:59terry.reedysetmessageid: <>
2020-11-07 10:00:59terry.reedylinkissue42222 messages
2020-11-07 10:00:58terry.reedycreate