Skip to content

Commit 83cc31c

Browse files
[too-many-positional-arguments doc] Add the main option to use, real example (#9957)
1 parent 30ae33f commit 83cc31c

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
class FiveArgumentMethods:
2-
"""The max positional arguments default is 5."""
1+
# +1: [too-many-positional-arguments]
2+
def calculate_drag_force(velocity, area, density, drag_coefficient):
3+
return 0.5 * drag_coefficient * density * area * velocity**2
34

4-
def take_five_args(self, a, b, c, d, e): # [too-many-positional-arguments]
5-
pass
5+
6+
drag_force = calculate_drag_force(30, 2.5, 1.225, 0.47)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
class FiveArgumentMethods:
2-
"""The max positional arguments default is 5."""
1+
def calculate_drag_force(*, velocity, area, density, drag_coefficient):
2+
return 0.5 * drag_coefficient * density * area * velocity**2
33

4-
def take_five_args(self, a, b, c, d, *, e=False):
5-
pass
4+
5+
drag_force = calculate_drag_force(
6+
velocity=30, area=2.5, density=1.225, drag_coefficient=0.47
7+
)
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
[MESSAGES CONTROL]
2-
disable=too-many-arguments
1+
[DESIGN]
2+
max-positional-arguments=3

0 commit comments

Comments
 (0)