On 01/06/2015 07:37 PM, Andrew Robinson wrote: > Explain; How does mere subclassing of bool break the contract that bool has? > eg: What method or data would the superclass have that my subclass would not?
bool's contract is that there are only two values (True and False) and only one instance each of those two values (True and False). If bool were subclassable, new values could be added with either completely different values (PartTrue) or with more of the same value (True, ReallyTrue, AbsolutelyTrue) -- hence, broken contract. -- ~Ethan~
signature.asc
Description: OpenPGP digital signature
-- https://mail.python.org/mailman/listinfo/python-list