[New-bugs-announce] [issue41719] Why does not range() support decimals?

chen-y0y0 report at bugs.python.org
Fri Sep 4 11:54:10 EDT 2020


New submission from chen-y0y0 <cyy144881 at icloud.com>:

# I try:
>>> range(0,5,0.5)
# I hope it will (0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5). But...
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    range(0,5,0.5)
TypeError: 'float' object cannot be interpreted as an integer

----------
components: Argument Clinic
messages: 376378
nosy: larry, prasechen
priority: normal
severity: normal
status: open
title: Why does not range() support decimals?
type: compile error
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41719>
_______________________________________


More information about the New-bugs-announce mailing list