Skip to content

Assert statements should analyze isinstance #904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jhance opened this issue Oct 11, 2015 · 2 comments
Closed

Assert statements should analyze isinstance #904

jhance opened this issue Oct 11, 2015 · 2 comments

Comments

@jhance
Copy link
Collaborator

jhance commented Oct 11, 2015

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
@jhance jhance closed this as completed Oct 11, 2015
@jhance
Copy link
Collaborator Author

jhance commented Oct 11, 2015

oops was a dup

@o11c
Copy link
Contributor

o11c commented Oct 11, 2015

For reference, the duplicate is #475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants