MCPcopy Index your code
hub / github.com/python/mypy / read

Method read

mypy/nodes.py:921–940  ·  view source on GitHub ↗
(cls, data: ReadBuffer)

Source from the content-addressed store, hash-verified

919
920 @classmethod
921 def read(cls, data: ReadBuffer) -> OverloadedFuncDef:
922 assert read_tag(data) == LIST_GEN
923 res = OverloadedFuncDef([read_overload_part(data) for _ in range(read_int_bare(data))])
924 typ = mypy.types.read_type_opt(data)
925 if typ is not None:
926 assert isinstance(typ, mypy.types.ProperType)
927 res.type = typ
928 res._fullname = read_str(data)
929 tag = read_tag(data)
930 if tag != LITERAL_NONE:
931 res.impl = read_overload_part(data, tag)
932 # set line for empty overload items, as not set in __init__
933 if len(res.items) > 0:
934 res.set_line(res.impl.line)
935 res.is_property, res.is_class, res.is_static, res.is_final = read_flags(data, num_flags=4)
936 res.deprecated = read_str_opt(data)
937 res.setter_index = read_int_opt(data)
938 # NOTE: res.info will be set in the fixup phase.
939 assert read_tag(data) == END_TAG
940 return res
941
942 def is_dynamic(self) -> bool:
943 return all(item.is_dynamic() for item in self.items)

Callers

nothing calls this directly

Calls 10

read_strFunction · 0.90
read_str_optFunction · 0.90
read_int_optFunction · 0.90
OverloadedFuncDefClass · 0.85
read_overload_partFunction · 0.85
rangeClass · 0.85
isinstanceFunction · 0.85
lenFunction · 0.85
read_flagsFunction · 0.85
set_lineMethod · 0.45

Tested by

no test coverage detected