[Python-projects] E0101 should be a warning

Sylvain Thénault sylvain.thenault at logilab.fr
Wed Nov 22 18:39:56 CET 2006


On Wednesday 22 November à 15:18, Barry Scott wrote:
> Michael Foord wrote:
> > Barry Scott wrote:
> >> E0101, Foo.__init__] Explicit return in __init__
> >>
> >> Why is this an error? I would have expected this to be a warning as 
> >> it a matter of style
> >> not correctness.
> >>   
> > But if it returns anything it is an error.
> Agreed. (I suspect that "return" and "return None" are
> the same in the ast).

yep, returning something else than None should be marked as an error
while returning nothing or None should be marked as a warning. Though
that last point is discussable...
I'll add this to the tracker.
-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Python et calcul scientifique:           http://www.logilab.fr/science



More information about the Python-Projects mailing list