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

Skip to content

Concatenate implementation generates runtime exception if parameterized by ... #48

Closed
@erictraut

Description

@erictraut

The following code should work without a runtime exception.

from typing import Any, Callable
from typing_extensions import ParamSpec, Concatenate


P = ParamSpec("P")
MyAlias = Callable[Concatenate[int, P], Any]

x: MyAlias[...]

It runs fine on Python 3.10 if using typing.Concatenate but fails on Python 3.9 if using typing_extensions.Concatenate. The runtime exception is:

TypeError: Parameters to generic types must be types. Got Ellipsis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions