Skip to content

Ban bogus "existential types" #7084

Closed

Description

@ilevkivskyi

It is possible to get an unbound type variable in a variable type using a generic alias, for example:

from typing import TypeVar, Dict
  
T = TypeVar('T')
Alias = Dict[str, T]

x: Alias[T]
reveal_type(x)  # Revealed type is 'builtins.dict[builtins.str, T?]'

This doesn't makes sense currently and should give an error.

See also #6520 (this looks very similar but is actually a different issue specific to type aliases).

Activity

  1. added a commit that references this issue on Nov 24, 2022
    13bd201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions