Files
openide/python/python-psi-impl/resources/inspectionDescriptions/PyNamedTupleInspection.html
Louis Vignierandintellij-monorepo-bot 1869ec9da6 [codeInspection] Fix python inspection descriptions
GitOrigin-RevId: 56876a5dd073a06c3fcc92f63ed1f5674830bc25
2023-04-28 13:13:25 +00:00

26 lines
541 B
HTML

<html>
<body>
<p>Reports invalid definition of a
<a href="https://docs.python.org/3/library/typing.html#typing.NamedTuple">typing.NamedTuple</a>.</p>
<p><b>Example:</b></p>
<pre><code>
import typing
class FullName(typing.NamedTuple):
first: str
last: str = ""
middle: str
</code></pre>
<p>As a fix, place the field with the default value after the fields without default values:</p>
<pre><code>
import typing
class FullName(typing.NamedTuple):
first: str
middle: str
last: str = ""
</code></pre>
</body>
</html>