Skip to content

Solve constraints from typevar upper bounds - #13221

Closed
hauntsaninja wants to merge 2 commits into
python:masterfrom
hauntsaninja:fix-typevar-subtyping
Closed

hauntsaninja wants to merge 2 commits into
python:masterfrom
hauntsaninja:fix-typevar-subtyping

Conversation

@hauntsaninja

Copy link
Copy Markdown
Collaborator

Fixes #13220

@hauntsaninja

Copy link
Copy Markdown
Collaborator Author

Well, mypy hated that.

I tried the following without success:

  • scoping it to just when upper_bound is builtins.object
  • moving the addition of the constraint to unify_generic_callable (which is where we need it)
  • then scoping that one just to when upper_bound is builtins.object
  • then removing the part in the solver where if there's a top type and no bottom type it picks the top type (as opposed to say, UninhabitedType)

@github-actions

This comment was marked as outdated.

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.

Incorrect subtyping with bound typevar

1 participant