Skip to content

Commit b659d05

Browse files
committed
Fix RST formatting for --warn-unreachable example
1 parent 02188af commit b659d05

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/source/command_line.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -537,13 +537,15 @@ potentially problematic or redundant in some way.
537537
print(x + "bad")
538538
Note that unreachable ``pass`` statements are intentionally not
539539
reported by this option. This allows ``pass`` to be used as a
540-
placeholder during development without triggering an error.For
541-
example::
540+
placeholder during development without triggering an error.
541+
542+
For example::
543+
544+
def f(x: int) -> None:
545+
if x > 0:
546+
return
547+
pass # no --warn-unreachable error is reported here
542548

543-
def f(x: int) -> None:
544-
if x > 0:
545-
return
546-
pass # no --warn-unreachable error is reported here
547549

548550
To help prevent mypy from generating spurious warnings, the "Statement is
549551
unreachable" warning will be silenced in exactly two cases:

0 commit comments

Comments
 (0)