Skip to content

(🎁) Convert code to utilize pep 695 #4617

Closed
@KotlinIsland

Description

@KotlinIsland

input:

from typing import TypeVar, TypeAlias, Generic

T = TypeVar("T", bound=float)
Foo: TypeAlias = str | T | None

class A(Generic[T]):
    ...

def f(t: T):
    ...

output:

type Foo[T: float] = str | T | None

class A[T: float]:
    ...

def f[T: float](t: T):
    ...

And also ParamSpec and TypeVarTuple.

Metadata

Metadata

Assignees

Labels

acceptedReady for implementationhelp wantedContributions especially welcomepython312Related to Python 3.12ruleImplementing or modifying a lint rule

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions