Skip to content

Commit 9125155

Browse files
committed
Remove __match_args__ field during IR preparation
1 parent af098b9 commit 9125155

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mypyc/irbuild/classdef.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ def find_attr_initializers(
625625
and not isinstance(stmt.rvalue, TempNode)
626626
):
627627
name = stmt.lvalues[0].name
628-
if name == "__slots__":
628+
if name in ("__slots__", "__match_args__"):
629629
continue
630630

631631
if name == "__deletable__":

mypyc/irbuild/prepare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def prepare_class_def(
224224

225225
if isinstance(node.node, Var):
226226
assert node.node.type, "Class member %s missing type" % name
227-
if not node.node.is_classvar and name not in ("__slots__", "__deletable__"):
227+
if not node.node.is_classvar and name not in ("__slots__", "__deletable__", "__match_args__"):
228228
ir.attributes[name] = mapper.type_to_rtype(node.node.type)
229229
elif isinstance(node.node, (FuncDef, Decorator)):
230230
prepare_method_def(ir, module_name, cdef, mapper, node.node)

0 commit comments

Comments
 (0)