Skip to content

Assert statements should analyze isinstance #904

Closed
@jhance

Description

@jhance

I can imagine this being useful for testing (where asserts are actually common and useful). Something like this should typecheck:

class A:
    pass

class B(A):
    attr = None

x = B() # type: A
assert isinstance(x, B)
x.attr

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions