File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1054,7 +1054,7 @@ def read(cls, data: BytesIO) -> FuncDef:
10541054 read_flags (data , ret , FUNCDEF_FLAGS )
10551055 # NOTE: ret.info is set in the fixup phase.
10561056 ret .arg_names = read_str_opt_list (data )
1057- ret .arg_kinds = [ArgKind ( ak ) for ak in read_int_list (data )]
1057+ ret .arg_kinds = [ARG_KINDS [ ak ] for ak in read_int_list (data )]
10581058 ret .abstract_status = read_int (data )
10591059 if read_int (data ) == OPT_YES :
10601060 ret .dataclass_transform_spec = DataclassTransformSpec .read (data )
Original file line number Diff line number Diff line change @@ -2010,7 +2010,9 @@ def write(self, data: BytesIO) -> None:
20102010 def read (cls , data : BytesIO ) -> Parameters :
20112011 return Parameters (
20122012 read_type_list (data ),
2013- [ArgKind (ak ) for ak in read_int_list (data )],
2013+ # This is a micro-optimization until mypyc gets dedicated enum support. Otherwise,
2014+ # we would spend ~20% of types deserialization time in Enum.__call__().
2015+ [ARG_KINDS [ak ] for ak in read_int_list (data )],
20142016 read_str_opt_list (data ),
20152017 variables = cast (list [TypeVarLikeType ], read_type_list (data )),
20162018 imprecise_arg_kinds = read_bool (data ),
@@ -2539,7 +2541,7 @@ def read(cls, data: BytesIO) -> CallableType:
25392541 fallback = Instance .read (data )
25402542 return CallableType (
25412543 read_type_list (data ),
2542- [ArgKind ( ak ) for ak in read_int_list (data )],
2544+ [ARG_KINDS [ ak ] for ak in read_int_list (data )],
25432545 read_str_opt_list (data ),
25442546 read_type (data ),
25452547 fallback ,
You can’t perform that action at this time.
0 commit comments