Skip to content

Can typing.TypeVar et al. be deprecated? #1983

@sh-at-cs

Description

@sh-at-cs

PEP 695 (Type Parameter Syntax) says:

The existing mechanism for allocating TypeVar, TypeVarTuple, and ParamSpec is retained for backward compatibility.

If that is the only reason they are kept around in typing, wouldn't it make sense to mark them as deprecated?

Or are there situations in which they still have advantages over PEP 695's dedicated syntax for type parameters?

The current Python docs just point out that a new syntax for type parameters exists, but don't say anything about deprecation:

Changed in version 3.12: Type variables can now be declared using the type parameter syntax introduced by PEP 695. The infer_variance parameter was added.

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions