Bug or Feature?

Stephan Diehl stephan.diehlNOSPAM at gmx.net
Mon Nov 24 18:13:34 CET 2003


Michael Hudson wrote:

> Stephan Diehl <stephan.diehl at gmx.net> writes:
> 
>> Although, the question was more along the line, if (in the light of the
>> principle of least surprise) this behaviour makes sense.
>> My private opinion would be, that the usefullness of builtin types as
>> real types would be much better, if they were safe under inheritance.
> 
> The problem is that it's impossible for the int type to know about the
> requirements of your subclass' constructor.  Explicit is better than
> implicit, and all that.
> 
> For the example you posted, I don't see much of an advantage to
> inheriting from int.

This is probably more a theoretical question, but if I decide to have an
operation within one specific domain, I want the result in that domain too.
Otherwise, there would be no point at all to define such a numeric class at
all.

Stephan
> 
> Cheers,
> mwh
> 





More information about the Python-list mailing list