class inheritance

JLundell jlundell at pobox.com
Thu Dec 23 18:21:42 EST 2010


That's nice, Ethan, especially in that it saves having to explicitly find and list all the methods being covered. It's perhaps not quite so critical for a Fraction-based class, since the set of methods to be covered is fairly well contained, but that's not always going to be the case.

The approach I mentioned earlier (rebinding __class__) is a little faster, since it avoids a call to __new__, but the difference is no doubt negligible in this example, since rational arithmetic isn't exactly lightning fast.

Thanks.



More information about the Python-list mailing list