OO in Python? ^^

Mike Meyer mwm at mired.org
Sun Dec 11 18:07:07 EST 2005


Bruno Desthuilliers <bdesth.quelquechose at free.quelquepart.fr> writes:
>>  ^^ There is no functionality to check if a subclass correctly
>> implements an inherited interface
>
> I don't know of any language that provide such a thing. At least for
> my definition of "correctly".

Well, since your definition of "correclty" is uknown, I won't use
it. I will point out that the stated goal is impossible for some
reasonable definitions of "correctly".

My definition of "correctly" is "meets the published contracts for the
methods."  Languages with good support for design by contract will
insure that subclasses either correctly implement the published
contracts, or raise an exception when they fail to do so. They do that
by checking the contracts for the super classes in an appropriate
logical relationship, and raising an exception if the contract isn't
met.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list