Skip to content

ParamSpec: bound, covariant, contravariant #1027

Open
@sobolevn

Description

@sobolevn

I found that right now ParamSpec allows three kw-only arguments: bound=None, covariant=False, contravariant=False. Just like PEP612 states:

The runtime should accept bounds and covariant and contravariant arguments in the declaration just as typing.TypeVar does, but for now we will defer the standardization of the semantics of those options to a later PEP.

What are the use-cases for this? How can ParamSpec can be bound to a value? Or how can it be covariant? It does not seem to be semantically valid.

Maybe we should remove these arguments? What do others think?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: otherOther topics not covered

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions