Skip to content

Commit d80e041

Browse files
committed
Revert "Make default return value for NodeVisitor explicitly optional"
This reverts commit 5d690be.
1 parent 5d690be commit d80e041

File tree

12 files changed

+288
-341
lines changed

12 files changed

+288
-341
lines changed

mypy/checkexpr.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5944,9 +5944,7 @@ def accept(
59445944
elif allow_none_return and isinstance(node, AwaitExpr):
59455945
typ = self.visit_await_expr(node, allow_none_return=True)
59465946
else:
5947-
typ_ = node.accept(self)
5948-
assert typ_ is not None
5949-
typ = typ_
5947+
typ = node.accept(self)
59505948
except Exception as err:
59515949
report_internal_error(
59525950
err, self.chk.errors.file, node.line, self.chk.errors, self.chk.options

mypy/checkpattern.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def accept(self, o: Pattern, type_context: Type) -> PatternType:
130130
result = o.accept(self)
131131
self.type_context.pop()
132132

133-
assert result is not None
134133
return result
135134

136135
def visit_as_pattern(self, o: AsPattern) -> PatternType:

0 commit comments

Comments
 (0)