Skip to content

Stub functions should only typecheck for None #4066

@Wilfred

Description

@Wilfred

This passes in mypy 0.521:

def foo(): # type: () -> int
    pass

mypy --py2 --strict demo.py does not show any errors. If a function body does not contain a return statement or a yield statement it should only have a type of None I believe.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions