9
9
10
10
import mypy .strconv
11
11
from mypy .visitor import NodeVisitor , StatementVisitor , ExpressionVisitor
12
- from mypy .util import short_type , IdMapper
12
+ from mypy .util import short_type
13
13
14
14
15
15
class Context :
@@ -1988,9 +1988,6 @@ class is generic then it will be a type constructor of higher kind.
1988
1988
# Is this a newtype type?
1989
1989
is_newtype = False
1990
1990
1991
- # Alternative to fullname() for 'anonymous' classes.
1992
- alt_fullname = None # type: Optional[str]
1993
-
1994
1991
FLAGS = [
1995
1992
'is_abstract' , 'is_enum' , 'fallback_to_any' , 'is_named_tuple' ,
1996
1993
'is_newtype'
@@ -2171,8 +2168,7 @@ def serialize(self) -> JsonDict:
2171
2168
data = {'.class' : 'TypeInfo' ,
2172
2169
'module_name' : self .module_name ,
2173
2170
'fullname' : self .fullname (),
2174
- 'alt_fullname' : self .alt_fullname ,
2175
- 'names' : self .names .serialize (self .alt_fullname or self .fullname ()),
2171
+ 'names' : self .names .serialize (self .fullname ()),
2176
2172
'defn' : self .defn .serialize (),
2177
2173
'abstract_attributes' : self .abstract_attributes ,
2178
2174
'type_vars' : self .type_vars ,
@@ -2194,7 +2190,6 @@ def deserialize(cls, data: JsonDict) -> 'TypeInfo':
2194
2190
module_name = data ['module_name' ]
2195
2191
ti = TypeInfo (names , defn , module_name )
2196
2192
ti ._fullname = data ['fullname' ]
2197
- ti .alt_fullname = data ['alt_fullname' ]
2198
2193
# TODO: Is there a reason to reconstruct ti.subtypes?
2199
2194
ti .abstract_attributes = data ['abstract_attributes' ]
2200
2195
ti .type_vars = data ['type_vars' ]
@@ -2303,14 +2298,7 @@ def serialize(self, prefix: str, name: str) -> JsonDict:
2303
2298
else :
2304
2299
if self .node is not None :
2305
2300
if prefix is not None :
2306
- # Check whether this is an alias for another object.
2307
- # If the object's canonical full name differs from
2308
- # the full name computed from prefix and name,
2309
- # it's an alias, and we serialize it as a cross ref.
2310
- if isinstance (self .node , TypeInfo ):
2311
- fullname = self .node .alt_fullname or self .node .fullname ()
2312
- else :
2313
- fullname = self .node .fullname ()
2301
+ fullname = self .node .fullname ()
2314
2302
if (fullname is not None and '.' in fullname and
2315
2303
fullname != prefix + '.' + name ):
2316
2304
data ['cross_ref' ] = fullname
0 commit comments