Skip to content

Commit 9defcd9

Browse files
author
Nicholas Mobbs
authored
Bump mypy to v0.800 (#140)
Updated args to use `tuple` instead of list as required since 109e15db of mypy.
1 parent 346338c commit 9defcd9

File tree

3 files changed

+411
-379
lines changed

3 files changed

+411
-379
lines changed

classes/contrib/mypy/typeclass_plugin.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@ def _adjust_arguments(ctx):
3030
if not isinstance(typeclass_def, CallableType):
3131
return ctx.default_return_type
3232

33-
ctx.default_return_type.args = [
33+
args = [
3434
typeclass_def.arg_types[0],
3535
typeclass_def.ret_type,
3636
]
3737

3838
# We use `Any` here to filter it later in `_add_new_type` method:
3939
typeclass_def.arg_types[0] = AnyType(TypeOfAny.unannotated)
40-
ctx.default_return_type.args.append(typeclass_def)
40+
41+
ctx.default_return_type.args = (
42+
*args,
43+
typeclass_def,
44+
)
4145
return ctx.default_return_type
4246

4347

@@ -87,7 +91,10 @@ def _adjust_typeclass_type(self, ctx, instance_type):
8791
))
8892

8993
if not isinstance(instance_type, TypeVarType):
90-
ctx.type.args[0] = UnionType.make_union(unified)
94+
ctx.type.args = (
95+
UnionType.make_union(unified),
96+
*ctx.type.args[1:],
97+
)
9198

9299
def _filter_out_unified_types(self, type_) -> bool:
93100
return not isinstance(type_, (AnyType, TypeVarType))

0 commit comments

Comments
 (0)