Components that implement clean() should call their parents' clean() using super().

Bug #274333 reported by Guillaume Emont
2
Affects Status Importance Assigned to Milestone
Moovida
Fix Released
Undecided
Guillaume Emont

Bug Description

You can find them them using pylint (as in 'aptitude install pylint') and a
checker I wrote, that you can find in tools/checker on the branch at
lp:~guijemont/elisa/memory_tools. Very basic instructions on how to use
that are provided at the beginning of the python file.
Note that the checker is not perfect and might have false positives.

Related branches

Changed in elisa:
assignee: nobody → guijemont
milestone: none → 0.5.11
status: New → In Progress
status: In Progress → Fix Committed
Revision history for this message
Alessandro Decina (alessandro.decina) wrote :

I would do an exceptions for components that inherit directly from Component though.
Component.clean returns a defer.succeed(self), so calling it doesn't add any value
and only makes the code less readable.

Revision history for this message
Alessandro Decina (alessandro.decina) wrote :

You pushed the changes already. Oh well.

Revision history for this message
Guillaume Emont (guijemont) wrote :

I think we need to do super(Blah, self).clean() everywhere we reimplement clean(), with no exception, else we end up with clean() implementations not called where we have diamond inheritance. (the super().clean() does more than calling the parent's clean, it is used to call a brother's clean as well).

yyoyo (lionel.martin)
Changed in elisa:
status: Fix Committed → Fix Released
Revision history for this message
Guillaume Emont (guijemont) wrote : Re: [Bug 274333] Re: Components that implement clean() should call their parents' clean() using super().

On a fait une release sans me dire ? Le fix a été mergé aujourd'hui
(jeudi 25 septembre)...

Guillaume

Le jeudi 25 septembre 2008 à 17:19 +0000, yyoyo a écrit :
> ** Changed in: elisa
> Status: Fix Committed => Fix Released
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.