Skip to content

Commit 33660db

Browse files
authored
Do not serialize line/column for type aliases (#19821)
It looks like it is actually not used for anything now. Also it may unnecessarily invalidate cache and mask possible bugs.
1 parent fd05265 commit 33660db

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

mypy/nodes.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4254,8 +4254,6 @@ def serialize(self) -> JsonDict:
42544254
"alias_tvars": [v.serialize() for v in self.alias_tvars],
42554255
"no_args": self.no_args,
42564256
"normalized": self.normalized,
4257-
"line": self.line,
4258-
"column": self.column,
42594257
"python_3_12_type_alias": self.python_3_12_type_alias,
42604258
}
42614259
return data
@@ -4270,15 +4268,13 @@ def deserialize(cls, data: JsonDict) -> TypeAlias:
42704268
target = mypy.types.deserialize_type(data["target"])
42714269
no_args = data["no_args"]
42724270
normalized = data["normalized"]
4273-
line = data["line"]
4274-
column = data["column"]
42754271
python_3_12_type_alias = data["python_3_12_type_alias"]
42764272
return cls(
42774273
target,
42784274
fullname,
42794275
module,
4280-
line,
4281-
column,
4276+
-1,
4277+
-1,
42824278
alias_tvars=cast(list[mypy.types.TypeVarLikeType], alias_tvars),
42834279
no_args=no_args,
42844280
normalized=normalized,
@@ -4291,8 +4287,6 @@ def write(self, data: Buffer) -> None:
42914287
write_str(data, self.module)
42924288
self.target.write(data)
42934289
mypy.types.write_type_list(data, self.alias_tvars)
4294-
write_int(data, self.line)
4295-
write_int(data, self.column)
42964290
write_bool(data, self.no_args)
42974291
write_bool(data, self.normalized)
42984292
write_bool(data, self.python_3_12_type_alias)
@@ -4307,8 +4301,8 @@ def read(cls, data: Buffer) -> TypeAlias:
43074301
target,
43084302
fullname,
43094303
module,
4310-
read_int(data),
4311-
read_int(data),
4304+
-1,
4305+
-1,
43124306
alias_tvars=alias_tvars,
43134307
no_args=read_bool(data),
43144308
normalized=read_bool(data),

0 commit comments

Comments
 (0)