mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
GitOrigin-RevId: 56876a5dd073a06c3fcc92f63ed1f5674830bc25
29 lines
638 B
HTML
29 lines
638 B
HTML
<html>
|
|
<body>
|
|
<p>Reports discrepancies between declared parameters and actual arguments, as well as
|
|
incorrect arguments, for example, duplicate named arguments, and incorrect argument order.</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
class Foo:
|
|
def __call__(self, p1: int, *, p2: str = "%"):
|
|
return p2 * p1
|
|
|
|
|
|
bar = Foo()
|
|
bar.__call__() # unfilled parameter
|
|
bar(5, "#") # unexpected argument
|
|
</code></pre>
|
|
<p>The correct code fragment looks at follows:</p>
|
|
<pre><code>
|
|
class Foo:
|
|
def __call__(self, p1: int, *, p2: str = "%"):
|
|
return p2 * p1
|
|
|
|
|
|
bar = Foo()
|
|
bar.__call__(5)
|
|
bar(5, p2="#")
|
|
</code></pre>
|
|
</body>
|
|
</html>
|