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 committed Sep 26, 2024
1 parent c7d9707 commit 5e00c37
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 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 @@ -134,9 +135,7 @@ def decode_agen_types_from_return_type(
return (
yield_type,
send_type,
UninhabitedType(
is_noreturn=True, line=ctx.context.line, column=ctx.context.column
),
UninhabitedType(line=ctx.context.line, column=ctx.context.column),
)
else:
return (
Expand Down Expand Up @@ -464,7 +463,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 +476,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 5e00c37

Please sign in to comment.