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

Email [Python-projects] return statement in __init__

subject
[Python-projects] return statement in __init__
date
2005/04/15 22:17
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.

As a side issue, it seems that I've just discovered a Python bug while
writing this test case. The exception is raised only for old-style
classes. I've already submitted a bug report.
attachment