] > Re: [Python-projects] return statement in __init__ (Logilab.org)

Email Re: [Python-projects] return statement in __init__

from
subject
Re: [Python-projects] return statement in __init__
date
2005/04/18 09:46
On Friday 15 April à 22:17, logilab.abcx@spamgourmet.com wrote:
> PyLint of the attached file:

> E0101 init_return LegalConstructor1.__init__ 3 Explicit return in __init__
> E0101 init_return LegalConstructor2.__init__ 8 Explicit return in __init__ 
> E0101 init_return IlegalConstructor.__init__ 13 Explicit return in __init__ 
> E0101 init_return LegalConstructorOld1.__init__ 18 Explicit return in __init__ 
> E0101 init_return LegalConstructorOld2.__init__ 23 Explicit return in __init__ 
> E0101 init_return IlegalConstructorOld.__init__ 28 Explicit return in __init__ 

> This error should be reported only for the IlegalConstructor classes
> since it's legal to return None or just return from a constructor.

IMHO it's a bad habit to have a return in __init__, valid or not valid.
Maybe should I turn the error into a warning when it's a "legal" return,
but I'm really not sure here. 

-- 
Sylvain Thénault                               LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects