Skip to content

Allow non-concrete TypeVar bounds #910

@ndmitchell

Description

@ndmitchell

Describe the Bug

from typing import *

ArgumentT = TypeVar("ArgumentT", bound=slice) # E: Type variable bounds and constraints must be concrete

This works fine in Pyright and Mypy.

Sandbox Link

https://pyrefly.org/sandbox/?code=GYJw9gtgBALgngBwJYDsDmUkQWEMoBUAUEQIIhoCuEApijACpQC8UDiNAagIYgAUAInJVa9BgIA0UAEZhKKACbMAzgBskAYxoBKIkA&version=3.12

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions