You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--warn-no-return Warns about functions that have no return statements if used in tandem with --strict-optional #2370
test.py: note: In member "__init__" of class "Foo":
test.py:2: note: Missing return statement
test.py: note: In member "increment_x" of class "Foo":
test.py:4: note: Missing return statement
This is just a bug caused by the fact that --strict-optional changes the meaning of returning None internally in mypy. It works fine without --strict-optional.
changed the title [-]--warn-no-return Warns about functions that have no return statements[/-][+]--warn-no-return Warns about functions that have no return statements if used in tandem with --strict-optional[/+]on Oct 28, 2016
Got it. Thanks @rwbarton for figuring out what I meant even though I forgot to specify what my flags were. Changed the title to reflect the actual problem.
Activity
rwbarton commentedon Oct 28, 2016
This is just a bug caused by the fact that
--strict-optionalchanges the meaning of returningNoneinternally in mypy. It works fine without--strict-optional.[-]--warn-no-return Warns about functions that have no return statements[/-][+]--warn-no-return Warns about functions that have no return statements if used in tandem with --strict-optional[/+]rowillia commentedon Oct 28, 2016
Got it. Thanks @rwbarton for figuring out what I meant even though I forgot to specify what my flags were. Changed the title to reflect the actual problem.
ddfisher commentedon Oct 28, 2016
So really this is just a problematic interaction between --warn-no-return and --strict-optional.