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).
> An early return certainly shouldn't be an error.
This is the false positive I see with:
def __init__( self, x ):
self.a = 1
if x > 0:
self.a = 2
a.py:2: [E0101, Foo.__init__] Explicit return in __init__