[issue37430] range is not a built-in function
Terry J. Reedy
report at bugs.python.org
Thu Jun 27 12:19:19 EDT 2019
Terry J. Reedy <tjreedy at udel.edu> added the comment:
I presume you are referring to 8.3 of the language reference
https://docs.python.org/3/reference/compound_stmts.html#the-for-statement
which has "the built-in function range()". Types/classes *are* functions, which is why dist, list, range, etc are listed in "Built-in Functions" in the library reference. But I agree that the more specific term should be used.
To me, the more severe problem is with the complete sentence.
"Hint: the built-in function range() returns an iterator of integers suitable to emulate the effect of Pascal’s for i := a to b do; e.g., list(range(3)) returns the list [0, 1, 2]."
The now obsolete definition of Python in terms of the now obscure Pascal should be deleted here and anywhere else such remains. I think the whole sentence should just be deleted. The whole paragraph and example could otherwise be improved.
----------
nosy: +terry.reedy
versions: +Python 3.9 -Python 3.5, Python 3.6
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37430>
_______________________________________
More information about the Python-bugs-list
mailing list