Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Report attribute access errors for TypeVar bound to Union. - #11140

Merged
hauntsaninja merged 3 commits into
python:masterfrom
tyralla:fix/typevar_bound_to_union
Sep 19, 2021
Merged

Report attribute access errors for TypeVar bound to Union.#11140
hauntsaninja merged 3 commits into
python:masterfrom
tyralla:fix/typevar_bound_to_union

Conversation

@tyralla

@tyralla tyralla commented Sep 18, 2021

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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