MCPcopy Create free account
hub / github.com/python/mypy / write

Method write

mypy/nodes.py:4281–4327  ·  view source on GitHub ↗
(self, data: WriteBuffer)

Source from the content-addressed store, hash-verified

4279 return ti
4280
4281 def write(self, data: WriteBuffer) -> None:
4282 write_tag(data, TYPE_INFO)
4283 self.names.write(data, self.fullname)
4284 self.defn.write(data)
4285 write_str(data, self.module_name)
4286 write_str(data, self.fullname)
4287 write_str_list(data, [a for a, _ in self.abstract_attributes])
4288 write_int_list(data, [s for _, s in self.abstract_attributes])
4289 write_str_list(data, self.type_vars)
4290 write_bool(data, self.has_param_spec_type)
4291 mypy.types.write_type_list(data, self.bases)
4292 write_str_list(data, [c.fullname for c in self.mro])
4293 mypy.types.write_type_list(data, self._promote)
4294 mypy.types.write_type_opt(data, self.alt_promote)
4295 mypy.types.write_type_opt(data, self.declared_metaclass)
4296 mypy.types.write_type_opt(data, self.metaclass_type)
4297 mypy.types.write_type_opt(data, self.tuple_type)
4298 mypy.types.write_type_opt(data, self.typeddict_type)
4299 write_flags(
4300 data,
4301 [
4302 self.is_abstract,
4303 self.is_enum,
4304 self.fallback_to_any,
4305 self.meta_fallback_to_any,
4306 self.is_named_tuple,
4307 self.is_newtype,
4308 self.is_protocol,
4309 self.runtime_protocol,
4310 self.is_final,
4311 self.is_disjoint_base,
4312 self.is_intersection,
4313 ],
4314 )
4315 write_json(data, self.metadata)
4316 if self.slots is None:
4317 write_tag(data, LITERAL_NONE)
4318 else:
4319 write_str_list(data, sorted(self.slots))
4320 write_str_list(data, self.deletable_attributes)
4321 mypy.types.write_type_opt(data, self.self_type)
4322 if self.dataclass_transform_spec is None:
4323 write_tag(data, LITERAL_NONE)
4324 else:
4325 self.dataclass_transform_spec.write(data)
4326 write_str_opt(data, self.deprecated)
4327 write_tag(data, END_TAG)
4328
4329 @classmethod
4330 def read(cls, data: ReadBuffer) -> TypeInfo:

Callers

nothing calls this directly

Calls 8

write_strFunction · 0.90
write_str_listFunction · 0.90
write_int_listFunction · 0.90
write_jsonFunction · 0.90
write_str_optFunction · 0.90
write_flagsFunction · 0.85
sortedFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected