@@ -3336,7 +3336,7 @@ from typing import Any
33363336class Test:
33373337 def __setattr__() -> None: ... \
33383338 # E: Invalid signature "Callable[[], None]" for "__setattr__" \
3339- # E: Method must have at least one argument . Did you forget the "self" argument ?
3339+ # E: Method must have at least one parameter . Did you forget the "self" parameter ?
33403340
33413341t = Test()
33423342t.crash = 'test' # E: Attribute function "__setattr__" with type "Callable[[], None]" does not accept self argument \
@@ -7829,7 +7829,7 @@ reveal_type(Foo().y) # N: Revealed type is "builtins.list[Any]"
78297829# flags: --check-untyped-defs
78307830
78317831class Foo:
7832- def bad(): # E: Method must have at least one argument . Did you forget the "self" argument ?
7832+ def bad(): # E: Method must have at least one parameter . Did you forget the "self" parameter ?
78337833 self.x = 0 # E: Name "self" is not defined
78347834
78357835[case testMethodSelfArgumentChecks]
@@ -7848,7 +7848,7 @@ def to_same_callable(fn: Callable[P, T]) -> Callable[P, T]:
78487848 return fn
78497849
78507850class A:
7851- def undecorated() -> None: ... # E: Method must have at least one argument . Did you forget the "self" argument ?
7851+ def undecorated() -> None: ... # E: Method must have at least one parameter . Did you forget the "self" parameter ?
78527852
78537853 def undecorated_not_self(x: int) -> None: ... # E: "self" parameter missing for a non-static method (or an invalid type for self)
78547854
@@ -7875,7 +7875,7 @@ class A:
78757875 return 0
78767876
78777877 @to_same_callable
7878- def g1() -> None: ... # E: Method must have at least one argument . Did you forget the "self" argument ?
7878+ def g1() -> None: ... # E: Method must have at least one parameter . Did you forget the "self" parameter ?
78797879
78807880 @to_same_callable
78817881 def g2(x: int) -> None: ... # E: "self" parameter missing for a non-static method (or an invalid type for self)
@@ -7937,11 +7937,11 @@ reveal_type(A().fn3) # N: Revealed type is "def (_x: builtins.int) -> builtins.
79377937
79387938class B:
79397939 @remove_first # E: Argument 1 to "remove_first" has incompatible type "Callable[[], int]"; expected "Callable[[T], int]"
7940- def fn1() -> int: # E: Method must have at least one argument . Did you forget the "self" argument ?
7940+ def fn1() -> int: # E: Method must have at least one parameter . Did you forget the "self" parameter ?
79417941 return 0
79427942
79437943 @remove_first
7944- def fn2(_x: int) -> int: # E: Method must have at least one argument . Did you forget the "self" argument ?
7944+ def fn2(_x: int) -> int: # E: Method must have at least one parameter . Did you forget the "self" parameter ?
79457945 return 0
79467946
79477947 @remove_first
@@ -8009,7 +8009,7 @@ def to_same_callable(fn: Callable[P, T]) -> Callable[P, T]:
80098009
80108010def unchecked():
80118011 class Bad:
8012- def fn() -> None: ... # E: Method must have at least one argument . Did you forget the "self" argument ?
8012+ def fn() -> None: ... # E: Method must have at least one parameter . Did you forget the "self" parameter ?
80138013 def fn2(x: int) -> None: ... # E: "self" parameter missing for a non-static method (or an invalid type for self)
80148014
80158015 # TODO: would be nice to make this error, but now we see the func
@@ -8030,29 +8030,29 @@ def unchecked():
80308030
80318031def checked() -> None:
80328032 class Bad:
8033- def fn() -> None: ... # E: Method must have at least one argument . Did you forget the "self" argument ?
8033+ def fn() -> None: ... # E: Method must have at least one parameter . Did you forget the "self" parameter ?
80348034 def fn2(x: int) -> None: ... # E: "self" parameter missing for a non-static method (or an invalid type for self)
80358035
80368036 @to_same_callable
8037- def g() -> None: ... # E: Method must have at least one argument . Did you forget the "self" argument ?
8037+ def g() -> None: ... # E: Method must have at least one parameter . Did you forget the "self" parameter ?
80388038 @to_same_callable
80398039 def g2(x: int) -> None: ... # E: "self" parameter missing for a non-static method (or an invalid type for self)
80408040
80418041 class AlsoBad:
8042- def fn(): ... # E: Method must have at least one argument . Did you forget the "self" argument ?
8042+ def fn(): ... # E: Method must have at least one parameter . Did you forget the "self" parameter ?
80438043 def fn2(x): ...
80448044
80458045 @to_same_callable
8046- def g(): ... # E: Method must have at least one argument . Did you forget the "self" argument ?
8046+ def g(): ... # E: Method must have at least one parameter . Did you forget the "self" parameter ?
80478047 @to_same_callable
80488048 def g2(x): ...
80498049
80508050class Ok:
8051- def fn(): ... # E: Method must have at least one argument . Did you forget the "self" argument ?
8051+ def fn(): ... # E: Method must have at least one parameter . Did you forget the "self" parameter ?
80528052 def fn2(x): ...
80538053
80548054 @to_same_callable
8055- def g(): ... # E: Method must have at least one argument . Did you forget the "self" argument ?
8055+ def g(): ... # E: Method must have at least one parameter . Did you forget the "self" parameter ?
80568056 @to_same_callable
80578057 def g2(x): ...
80588058[builtins fixtures/tuple.pyi]
0 commit comments