You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One other thing that might be nice would be to unquote annotations. E.g. old-style type variables often need to quote their bounds if the bound needs to use a forward reference to a name not yet defined
fromtypingimportGeneric, TypeVarT=TypeVar("T", bound="list[T | None]")
classFoo(Generic[T]):
var: T
But the bounds for PEP-695 type parameters are lazily evaluated, so there's no need to quote forward references:
>>> class Foo[T: list[T |None]]:
... var: T
...
>>> Foo.__type_params__[0].__bound__
list[typing.Optional[T]]
Follow up tasks from #15565
[_T]
)default
kwargs for Python >= 3.13ExprGenerator
TypeVarTuple
generics withUnpack
instead of*
:class MultipleGenerics(Generic[S, T, Unpack[Ts], P]): ...
1Related: #4617, #12542
Footnotes
https://github.com/astral-sh/ruff/pull/15565#discussion_r1925489033 ↩
The text was updated successfully, but these errors were encountered: