Implement check for return <value>, yield, yield <value>, or yield from <value> in class __init__() method. No values should be returned or yielded, only bare returns are ok.
These would be runtime errors, if and when these statements are reached.
This does trigger on return None which is equivalent to return, but kind of confusing and pointless to write in a function that shouldn't return anything.
Implement check for
return <value>
,yield
,yield <value>
, oryield from <value>
in class__init__()
method. No values should be returned or yielded, only barereturn
s are ok.These would be runtime errors, if and when these statements are reached.
This does trigger on
return None
which is equivalent toreturn
, but kind of confusing and pointless to write in a function that shouldn't return anything.