File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -2933,9 +2933,10 @@ def t(self, arg):
29332933 def _ (self , arg : int ):
29342934 return "int"
29352935 @t .register
2936- def _ (self , arg : str ):
2936+ def _ (self , / , arg : str ):
29372937 return "str"
2938- def _ (self , arg : bytes ):
2938+ # See GH-130827.
2939+ def _ (self : typing .Self , arg : bytes ):
29392940 return "bytes"
29402941 @t .register
29412942 @functools .wraps (_ )
@@ -3623,21 +3624,6 @@ def _(self, arg):
36233624 self .assertEqual (a .v (0 ), ('special' , 0 ))
36243625 self .assertEqual (a .v (2.5 ), ('general' , 2.5 ))
36253626
3626- def test_method_self_annotation (self ):
3627- """See GH-130827."""
3628- class A :
3629- @functools .singledispatchmethod
3630- def u (self : typing .Self , arg : int | str ) -> int | str :
3631- return None
3632-
3633- @u .register
3634- def _ (self : typing .Self , arg : int ) -> int :
3635- return arg
3636-
3637- a = A ()
3638- self .assertEqual (a .u (42 ), 42 )
3639- self .assertEqual (a .u ("hello" ), None )
3640-
36413627
36423628class CachedCostItem :
36433629 _cost = 1
You can’t perform that action at this time.
0 commit comments