'super' to only be used for diamond inheritance problems?

bruno at modulix onurb at xiludom.gro
Mon Oct 31 15:23:05 CET 2005


Alex Hunsley wrote:
> I've seen a few discussion about the use of 'super' in Python, including
> the opinion that 'super' should only be used to solve inheritance
> diamond problem. (And that a constructor that wants to call the
> superclass methods should just call them by name and forget about super.)
> What is people's opinion on this? Does it make any sense?

<imho>
Since you'll never know how your class will be used, better to stick
with super... super(MyClass, self).dothis() is no more difficult to use
than MySuperClass.dothis(self), and does not require much more typing,
so I don't see any reason not to use it.
</imho>


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list