Skip to content

Commit

Permalink
Update plugin.py
Browse files Browse the repository at this point in the history
Use TypeVarId for mypy 1.11
Don't use is_noreturn
  • Loading branch information
Redoubts authored and Paul Thompson committed Sep 26, 2024
1 parent c7d9707 commit 83cc600
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions trio_typing/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
Overloaded,
TypeVarLikeType,
TypeVarType,
TypeVarId,
Instance,
UnionType,
UninhabitedType,
Expand Down Expand Up @@ -135,7 +136,7 @@ def decode_agen_types_from_return_type(
yield_type,
send_type,
UninhabitedType(
is_noreturn=True, line=ctx.context.line, column=ctx.context.column
line=ctx.context.line, column=ctx.context.column
),
)
else:
Expand Down Expand Up @@ -464,7 +465,7 @@ def start_soon(
TypeVarType(
"__T{}".format(arg_idx),
"__T{}".format(arg_idx),
-len(fn_type.variables) - arg_idx - 1,
TypeVarId(-len(fn_type.variables) - arg_idx - 1),
[],
ctx.api.named_generic_type("builtins.object", []),
line=ctx.context.line,
Expand All @@ -477,7 +478,7 @@ def start_soon(
TypeVarType(
"__T{}".format(arg_idx),
"__T{}".format(arg_idx),
-len(fn_type.variables) - arg_idx - 1,
TypeVarId(-len(fn_type.variables) - arg_idx - 1),
[],
ctx.api.named_generic_type("builtins.object", []),
line=ctx.context.line,
Expand Down

0 comments on commit 83cc600

Please sign in to comment.