[AstroPy] Coding Guidelines draft (comments encouraged)
geert at barentsen.be
Sun Jul 24 17:48:47 EDT 2011
> Like Chris B, I'd have thought the case where superclasses are
> "orthogonal bases" (I think that's what you mean by mixins) would
> not present problems.
One could argue that the 'orthogonal bases' might become non-orthogonal by
accident at some point in the future (i.e. someone adding a new feature),
which could lead to an obscure bug. This is particularly true for a big
project or library where you might not be aware of all subclasses.
On the other hand, PyFITS demonstrates that multiple inheritance does not
impede a library to be excellent and very useful :-)) Certainly seems fine
to be pragmatic on this one.
The main issue is that beginning OO programmers tend to be drawn to multiple
inheritance when designing their first projects, while single inheritance
would do fine in most cases. So, a useful guideline may be "Avoid multiple
inheritance unless you understand the dirty details" :-)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the AstroPy