[issue37430] range is not a built-in function

2019-06-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Then it appears the indexing could also be improved.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37430] range is not a built-in function

2019-06-27 Thread bob gailer


bob gailer  added the comment:

Thanks for explaining. Indeed range appears in __builtins__. It is a surprise 
to type range and get  in response. sum otoh gives . The distinction between function, type and class seems muddy.

When I enter "range" in the index box in the windows documentation display I am 
offered: 

(1)built-in function, which takes me to the paragraph that started this issue. 
It does NOT take me to the built-in functions topic, whereas sum does.

(2) object, and range (built-in class)which take me to the built-in types 
topic. This seems to add to the confusion.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37430] range is not a built-in function

2019-06-27 Thread Terry J. Reedy

Terry J. Reedy  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37430] range is not a built-in function

2019-06-27 Thread bob gailer


New submission from bob gailer :

In section 8.3 The for statement there is a reference to range as a built-in 
function. That was true in python 2. Now range is a built-in type.

--
assignee: docs@python
components: Documentation
messages: 346745
nosy: bgailer, docs@python
priority: normal
severity: normal
status: open
title: range is not a built-in function
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com