File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff 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:
You can’t perform that action at this time.
0 commit comments