27 lines
536 B
Plaintext
27 lines
536 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
With a maximum number of 4 parameters:
|
|
|
|
----
|
|
def do_something(param1, param2, param3, param4, param5): # Noncompliant
|
|
...
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
def do_something(param1, param2, param3, param4):
|
|
...
|
|
|
|
# Or
|
|
|
|
def do_something(param1, param2, param3, param4, param5="a default value"):
|
|
...
|
|
----
|
|
|
|
== Exceptions
|
|
|
|
The first argument of non-static methods, i.e. <code>self</code> or <code>cls</code>, is not counted as it is mandatory and it is passed automatically.
|