The type/object distinction and possible synthesis of OOP and imperative programming languages

Terry Jan Reedy tjreedy at udel.edu
Tue Apr 16 12:49:01 EDT 2013


On 4/16/2013 5:07 AM, Antoon Pardon wrote:
> Op 16-04-13 05:17, Terry Jan Reedy schreef:
>> On 4/15/2013 10:32 PM, Steven D'Aprano wrote:
>>> On Mon, 15 Apr 2013 20:52:58 -0400, Terry Jan Reedy wrote:
>>

>> I will keep the above in mind if I write or review a patch. here are 4
>> non-subclassable builtin classes. Two are already documented. Bool in
>> one, forget which other. I believe it was recently decided to leave
>> the other two as is given the absence of any practical use case.
>
> Why should there be a practical use case here?

As a practical matter, the change is non-trivial. Someone has to be 
motivated to write the patch to enable subclassing, write tests, and 
consider the effect on internal C uses of slice and stdlib Python used 
of slice (type() versus isinstance).

> Since classes are in general subclassable,

if written in Python, but not if written in C.

> I once had an idea of a slice-like class that I would have liked to
> experiment with.

Did the idea actually require that instances *be* a slice rather than 
*wrap* a slice?

--
Terry Jan Reedy






More information about the Python-list mailing list