diff --git a/peps/pep-0696.rst b/peps/pep-0696.rst index ce1678adc..7e8f7f1e1 100644 --- a/peps/pep-0696.rst +++ b/peps/pep-0696.rst @@ -382,6 +382,21 @@ Function Defaults functions as ensuring the ``default`` is returned in every code path where the ``TypeVarLike`` can go unsolved is too hard to implement. +Binding rules +------------- + +``TypeVarLikes`` defaults should be bound by attribute access +(including call and subscript). + +.. code-block:: python + + class Foo[T = int]: + def meth(self) -> Self: + return self + + reveal_type(Foo.meth) # type is (self: Foo[int]) -> Foo[int] + + Implementation --------------