2015-07-03 0:01 GMT+02:00 Terry Reedy <tjreedy@udel.edu>:
On 7/2/2015 4:20 PM, Pierre Quentel wrote:

I agree that this is a blocking issue : as far as I know all Python
built-in functions return objects of a given type, regardless of its
arguments.

That is generally true.  But classes always return instances of the class when called, and range is a class, not a function.

>>> range
<class 'range'>
>>> class A(range):pass
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: type 'range' is not an acceptable base type
>>>

So yes, range is a class, but a strange one
 


--
Terry Jan Reedy

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/