Skip to content

Commit 87e5d6c

Browse files
committed
Oh wow
1 parent 287a344 commit 87e5d6c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

mypy/messages.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,7 +2520,8 @@ def quote_type_string(type_string: str) -> str:
25202520
if (
25212521
type_string in ["Module", "overloaded function", "<deleted>"]
25222522
or type_string.startswith("Module ")
2523-
or short_tuple_or_union(type_string)
2523+
or type_string.startswith(("<tuple ", "<union "))
2524+
and type_string.endswith(" item>")
25242525
or type_string.endswith("?")
25252526
):
25262527
# Messages are easier to read if these aren't quoted. We use a
@@ -2529,12 +2530,6 @@ def quote_type_string(type_string: str) -> str:
25292530
return f'"{type_string}"'
25302531

25312532

2532-
def short_tuple_or_union(typ: str) -> bool:
2533-
if not (typ.startswith("<tuple ") or typ.startswith("<union ")):
2534-
return False
2535-
return typ.endswith(" item>")
2536-
2537-
25382533
def format_callable_args(
25392534
arg_types: list[Type],
25402535
arg_kinds: list[ArgKind],

0 commit comments

Comments
 (0)