Skip to content

Deoptionalization not detected #2567

@rkr-at-dbx

Description

@rkr-at-dbx

Under --strict-optional, the following yields an error:

f=None  # type: Optional[Callable[..., None]]

# ...

if f is None:
    f = lambda *x: None
f()  # error: None not callable

Ideally, f should be understood not to be None at that point.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions