@@ -3339,7 +3339,7 @@ class Test:
33393339 # E: Method must have at least one argument. Did you forget the "self" argument?
33403340
33413341t = Test()
3342- t.crash = 'test' # E: Attribute function "__setattr__" with type "Callable[[], None]" does not accept self argument \
3342+ t.crash = 'test' # E: Attribute function "__setattr__" with type "Callable[[], None]" does not accept self parameter \
33433343 # E: "Test" has no attribute "crash"
33443344
33453345class A:
@@ -3574,7 +3574,7 @@ class B:
35743574 a = A
35753575 bad = lambda: 42
35763576
3577- B().bad() # E: Attribute function "bad" with type "Callable[[], int]" does not accept self argument
3577+ B().bad() # E: Attribute function "bad" with type "Callable[[], int]" does not accept self parameter
35783578reveal_type(B.a) # N: Revealed type is "def () -> __main__.A"
35793579reveal_type(B().a) # N: Revealed type is "def () -> __main__.A"
35803580reveal_type(B().a()) # N: Revealed type is "__main__.A"
@@ -5286,9 +5286,9 @@ reveal_type(A.g4) # N: Revealed type is "def () -> def () -> __main__.A"
52865286class B(metaclass=M):
52875287 def foo(self): pass
52885288
5289- B.g1 # E: Invalid self argument "type[B]" to attribute function "g1" with type "Callable[[type[A]], A]"
5290- B.g2 # E: Invalid self argument "type[B]" to attribute function "g2" with type "Callable[[type[TA]], TA]"
5291- B.g3 # E: Invalid self argument "type[B]" to attribute function "g3" with type "Callable[[TTA], TTA]"
5289+ B.g1 # E: Invalid self parameter "type[B]" to attribute function "g1" with type "Callable[[type[A]], A]"
5290+ B.g2 # E: Invalid self parameter "type[B]" to attribute function "g2" with type "Callable[[type[TA]], TA]"
5291+ B.g3 # E: Invalid self parameter "type[B]" to attribute function "g3" with type "Callable[[TTA], TTA]"
52925292reveal_type(B.g4) # N: Revealed type is "def () -> def () -> __main__.B"
52935293
52945294# 4 examples of unsoundness - instantiation, classmethod, staticmethod and ClassVar:
@@ -5301,9 +5301,9 @@ reveal_type(ta.g3) # N: Revealed type is "def () -> type[__main__.A]"
53015301reveal_type(ta.g4) # N: Revealed type is "def () -> type[__main__.A]"
53025302
53035303x: M = ta
5304- x.g1 # E: Invalid self argument "M" to attribute function "g1" with type "Callable[[type[A]], A]"
5305- x.g2 # E: Invalid self argument "M" to attribute function "g2" with type "Callable[[type[TA]], TA]"
5306- x.g3 # E: Invalid self argument "M" to attribute function "g3" with type "Callable[[TTA], TTA]"
5304+ x.g1 # E: Invalid self parameter "M" to attribute function "g1" with type "Callable[[type[A]], A]"
5305+ x.g2 # E: Invalid self parameter "M" to attribute function "g2" with type "Callable[[type[TA]], TA]"
5306+ x.g3 # E: Invalid self parameter "M" to attribute function "g3" with type "Callable[[TTA], TTA]"
53075307reveal_type(x.g4) # N: Revealed type is "def () -> __main__.M"
53085308
53095309def r(ta: Type[TA], tta: TTA) -> None:
@@ -7889,11 +7889,11 @@ reveal_type(A().fn3) # N: Revealed type is "builtins.int"
78897889reveal_type(A().fn4) # N: Revealed type is "builtins.int"
78907890reveal_type(A().fn5) # N: Revealed type is "builtins.int"
78917891
7892- reveal_type(A().g1) # E: Attribute function "g1" with type "Callable[[], None]" does not accept self argument \
7892+ reveal_type(A().g1) # E: Attribute function "g1" with type "Callable[[], None]" does not accept self parameter \
78937893 # N: Revealed type is "def ()"
7894- reveal_type(A().g2) # E: Invalid self argument "A" to attribute function "g2" with type "Callable[[int], None]" \
7894+ reveal_type(A().g2) # E: Invalid self parameter "A" to attribute function "g2" with type "Callable[[int], None]" \
78957895 # N: Revealed type is "def ()"
7896- reveal_type(A().g3) # E: Invalid self argument "A" to attribute function "g3" with type "Callable[[int], None]" \
7896+ reveal_type(A().g3) # E: Invalid self parameter "A" to attribute function "g3" with type "Callable[[int], None]" \
78977897 # N: Revealed type is "def ()"
78987898[builtins fixtures/tuple.pyi]
78997899
@@ -7931,7 +7931,7 @@ class A:
79317931 return 0
79327932
79337933reveal_type(A().fn1) # N: Revealed type is "def () -> builtins.int"
7934- reveal_type(A().fn2) # E: Invalid self argument "A" to attribute function "fn2" with type "Callable[[int], int]" \
7934+ reveal_type(A().fn2) # E: Invalid self parameter "A" to attribute function "fn2" with type "Callable[[int], int]" \
79357935 # N: Revealed type is "def () -> builtins.int"
79367936reveal_type(A().fn3) # N: Revealed type is "def (_x: builtins.int) -> builtins.int"
79377937
@@ -7952,11 +7952,11 @@ class B:
79527952 def fn4(self, new_self: 'B') -> int:
79537953 return 0
79547954
7955- reveal_type(B().fn1) # E: Attribute function "fn1" with type "Callable[[], int]" does not accept self argument \
7955+ reveal_type(B().fn1) # E: Attribute function "fn1" with type "Callable[[], int]" does not accept self parameter \
79567956 # N: Revealed type is "def () -> builtins.int"
7957- reveal_type(B().fn2) # E: Attribute function "fn2" with type "Callable[[], int]" does not accept self argument \
7957+ reveal_type(B().fn2) # E: Attribute function "fn2" with type "Callable[[], int]" does not accept self parameter \
79587958 # N: Revealed type is "def () -> builtins.int"
7959- reveal_type(B().fn3) # E: Invalid self argument "B" to attribute function "fn3" with type "Callable[[int], int]" \
7959+ reveal_type(B().fn3) # E: Invalid self parameter "B" to attribute function "fn3" with type "Callable[[int], int]" \
79607960 # N: Revealed type is "def () -> builtins.int"
79617961reveal_type(B().fn4) # N: Revealed type is "def () -> builtins.int"
79627962
@@ -7990,11 +7990,11 @@ class D:
79907990 def fn3(self, _x: int) -> int: # E: "self" parameter missing for a non-static method (or an invalid type for self)
79917991 return 0
79927992
7993- reveal_type(D().fn1) # E: Invalid self argument "D" to attribute function "fn1" with type "Callable[[int], int]" \
7993+ reveal_type(D().fn1) # E: Invalid self parameter "D" to attribute function "fn1" with type "Callable[[int], int]" \
79947994 # N: Revealed type is "def () -> builtins.int"
7995- reveal_type(D().fn2) # E: Invalid self argument "D" to attribute function "fn2" with type "Callable[[int, int], int]" \
7995+ reveal_type(D().fn2) # E: Invalid self parameter "D" to attribute function "fn2" with type "Callable[[int, int], int]" \
79967996 # N: Revealed type is "def (_x: builtins.int) -> builtins.int"
7997- reveal_type(D().fn3) # E: Invalid self argument "D" to attribute function "fn3" with type "Callable[[int, D, int], int]" \
7997+ reveal_type(D().fn3) # E: Invalid self parameter "D" to attribute function "fn3" with type "Callable[[int, D, int], int]" \
79987998 # N: Revealed type is "def (self: __main__.D, _x: builtins.int) -> builtins.int"
79997999[builtins fixtures/tuple.pyi]
80008000
@@ -9360,7 +9360,7 @@ class C(B):
93609360 prop_t = AT.prop # E: Incompatible types in assignment (expression has type "C", base class "B" defined the type as "str")
93619361
93629362reveal_type(C().prop) # N: Revealed type is "builtins.str"
9363- C().prop = "no" # E: Invalid self argument "C" to attribute function "prop" with type "Callable[[A, str], None]"
9363+ C().prop = "no" # E: Invalid self parameter "C" to attribute function "prop" with type "Callable[[A, str], None]"
93649364reveal_type(C().prop_t) # N: Revealed type is "__main__.C"
93659365C().prop_t = 1 # E: Incompatible types in assignment (expression has type "int", variable has type "list[C]")
93669366[builtins fixtures/property.pyi]
0 commit comments