KEMBAR78
Report attribute access errors for TypeVar bound to Union. by tyralla · Pull Request #11140 · python/mypy · GitHub
Skip to content

Conversation

tyralla
Copy link
Collaborator

@tyralla tyralla commented Sep 18, 2021

Fixes #10948

I have briefly discussed the problem with @hauntsaninja on Gitter.

The solution is straightforward. All checks were there, but a missing isinstance check prevented the detected errors from being reported.

The added test case includes examples for getting, setting, and deleting undefined attributes.

@hauntsaninja
Copy link
Collaborator

Looks great, thanks for triaging and fixing!

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

Successfully merging this pull request may close these issues.

generics with a union bound aren't type checked

2 participants