We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7285830 commit 02188afCopy full SHA for 02188af
docs/source/command_line.rst
@@ -535,6 +535,15 @@ potentially problematic or redundant in some way.
535
else:
536
# Error: 'Statement is unreachable' error
537
print(x + "bad")
538
+ Note that unreachable ``pass`` statements are intentionally not
539
+ reported by this option. This allows ``pass`` to be used as a
540
+ placeholder during development without triggering an error.For
541
+ example::
542
+
543
+ def f(x: int) -> None:
544
+ if x > 0:
545
+ return
546
+ pass # no --warn-unreachable error is reported here
547
548
To help prevent mypy from generating spurious warnings, the "Statement is
549
unreachable" warning will be silenced in exactly two cases:
0 commit comments