Skip to content

Commit 3be5b1c

Browse files
authored
Remove free return in snippet (#2076)
1 parent 05afd79 commit 3be5b1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/guides/writing_stubs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ This avoid forcing the user to check for ``None``::
811811
match = re.fullmatch(r"\d+_(.*)", some_string)
812812
assert match is not None
813813
name_group = match.group(1) # The user knows that this will never be None
814-
return name_group.uper() # This typo will be flagged by the type checker
814+
name_group.uper() # This typo will be flagged by the type checker
815815

816816
In this case, the user of ``match.group()`` must be prepared to handle a ``str``,
817817
but type checkers are happy with ``if name_group is None`` checks, because we're

0 commit comments

Comments
 (0)