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
Copy file name to clipboardexpand all lines: ERRORCODES.md
+1
Original file line number
Diff line number
Diff line change
@@ -95,3 +95,4 @@ recommend only using `--extend-select`, never `--select`.
95
95
| Code | Description | Code category
96
96
|------|-------------|---------------
97
97
| <aid="Y090"href="#Y090">Y090</a> | `tuple[int]` means "a tuple of length 1, in which the sole element is of type `int`". Consider using `tuple[int, ...]` instead, which means "a tuple of arbitrary (possibly 0) length, in which all elements are of type `int`". | Correctness
98
+
| <aid="Y091"href="#Y091">Y091</a> | Protocol methods should not have positional-or-keyword parameters. Usually, a positional-only parameter is better.
defmethod1(self, arg: int) ->None: ... # Y091 Argument "arg" to protocol method "method1" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
# Ensure Y091 recognizes this as pos-only for the benefit of users still
11
+
# using the old syntax.
12
+
defmethod6(self, __arg: int) ->None: ... # Y063 Use PEP-570 syntax to indicate positional-only arguments
13
+
@staticmethod
14
+
defsmethod1(arg: int) ->None: ... # Y091 Argument "arg" to protocol method "smethod1" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
0 commit comments