-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[too-many-positional-arguments doc] Add the main option to use, real …
…example (#9957)
- Loading branch information
1 parent
30ae33f
commit 83cc31c
Showing
3 changed files
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
class FiveArgumentMethods: | ||
"""The max positional arguments default is 5.""" | ||
# +1: [too-many-positional-arguments] | ||
def calculate_drag_force(velocity, area, density, drag_coefficient): | ||
return 0.5 * drag_coefficient * density * area * velocity**2 | ||
|
||
def take_five_args(self, a, b, c, d, e): # [too-many-positional-arguments] | ||
pass | ||
|
||
drag_force = calculate_drag_force(30, 2.5, 1.225, 0.47) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
class FiveArgumentMethods: | ||
"""The max positional arguments default is 5.""" | ||
def calculate_drag_force(*, velocity, area, density, drag_coefficient): | ||
return 0.5 * drag_coefficient * density * area * velocity**2 | ||
|
||
def take_five_args(self, a, b, c, d, *, e=False): | ||
pass | ||
|
||
drag_force = calculate_drag_force( | ||
velocity=30, area=2.5, density=1.225, drag_coefficient=0.47 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[MESSAGES CONTROL] | ||
disable=too-many-arguments | ||
[DESIGN] | ||
max-positional-arguments=3 |