[AstroPy] Coding Guidelines draft (comments encouraged)

James Turner jturner at gemini.edu
Tue Aug 16 14:01:07 EDT 2011

>> I would change the coding guidelines read opposite of how they do
>> currently: Use of super() should be encouraged except where one knows
>> for sure that it's not going to be appropriate, due to the need for a
>> customized method resolution order.  What *should* be discouraged is the
>> use of multiple inheritance except in the cases of orthogonal bases, or
>> if one is really sure what they're doing.
> You raise some very good points - my main concern was that it always
> be consistently super() or consistently not . I can see that use of
> super() would be a safer guideline given these use cases - does anyone
> object to this?

It's good to see these guidelines benefiting from everyone's experience
-- my only comment would be to encourage good examples for those of us
who are still a bit unsure exactly what super does and why :-).
(I know it won't matter for simple cases that we're most likely to use.)

BTW, I notice that the Python docs say super only works for new-style
classes, so perhaps our guidelines should require those (I don't think
they are part of PEP 8)?



More information about the AstroPy mailing list