Skip to content

Commit 5e00c37

Browse files
committed
Update plugin.py
Use TypeVarId for mypy 1.11 Don't use is_noreturn
1 parent c7d9707 commit 5e00c37

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

trio_typing/plugin.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
Overloaded,
2323
TypeVarLikeType,
2424
TypeVarType,
25+
TypeVarId,
2526
Instance,
2627
UnionType,
2728
UninhabitedType,
@@ -134,9 +135,7 @@ def decode_agen_types_from_return_type(
134135
return (
135136
yield_type,
136137
send_type,
137-
UninhabitedType(
138-
is_noreturn=True, line=ctx.context.line, column=ctx.context.column
139-
),
138+
UninhabitedType(line=ctx.context.line, column=ctx.context.column),
140139
)
141140
else:
142141
return (
@@ -464,7 +463,7 @@ def start_soon(
464463
TypeVarType(
465464
"__T{}".format(arg_idx),
466465
"__T{}".format(arg_idx),
467-
-len(fn_type.variables) - arg_idx - 1,
466+
TypeVarId(-len(fn_type.variables) - arg_idx - 1),
468467
[],
469468
ctx.api.named_generic_type("builtins.object", []),
470469
line=ctx.context.line,
@@ -477,7 +476,7 @@ def start_soon(
477476
TypeVarType(
478477
"__T{}".format(arg_idx),
479478
"__T{}".format(arg_idx),
480-
-len(fn_type.variables) - arg_idx - 1,
479+
TypeVarId(-len(fn_type.variables) - arg_idx - 1),
481480
[],
482481
ctx.api.named_generic_type("builtins.object", []),
483482
line=ctx.context.line,

0 commit comments

Comments
 (0)