When ‘super’ is not a good idea
jeanmichel at sequans.com
Thu Oct 8 15:28:37 CEST 2009
> Jean-Michel Pichavant <jeanmic... at sequans.com> wrote:
>> alex23 wrote:
>>> To me, the explicit reference to the base class violates DRY. It also
>>> means you need to manually change all such references should the base
>>> class ever change, something that using super() avoids.
>> I found the correct answer
> I'm not entirely sure how an opinion + explanation of the underlying
> mechanics is more or less "correct" than a development principle...
The correctness applies to my answer, not the super mechanism. The super
mechanism is correct and properly documented since python 2.6, so anyone
is free to use it.
I'm just trying to give arguments in favor of using the explicit base
class name instead of super.
And in my opinion, explicit names are (slightly) better because there's
no underlying explanation required when using the base class name
instead of super.
More information about the Python-list