Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mypy/strconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,9 @@ def visit_name_expr(self, o: mypy.nodes.NameExpr) -> str:
o.name, o.kind, o.fullname, o.is_inferred_def or o.is_special_form, o.node
)
if isinstance(o.node, mypy.nodes.Var) and o.node.is_final:
pretty += f" = {o.node.final_value}"
final_value = o.node.final_value
if final_value is not None:
pretty += f" = {o.node.final_value}"
return short_type(o) + "(" + pretty + ")"

def pretty_name(
Expand Down
Loading