MCPcopy
hub / github.com/pydantic/pydantic / serialize

Method serialize

pydantic/mypy.py:401–414  ·  view source on GitHub ↗

Based on mypy.plugins.dataclasses.DataclassAttribute.serialize.

(self)

Source from the content-addressed store, hash-verified

399 return Var(name, self.expand_type(current_info, api, force_typevars_invariant))
400
401 def serialize(self) -> JsonDict:
402 """Based on mypy.plugins.dataclasses.DataclassAttribute.serialize."""
403 assert self.type
404 return {
405 'name': self.name,
406 'alias': self.alias,
407 'is_frozen': self.is_frozen,
408 'has_dynamic_alias': self.has_dynamic_alias,
409 'has_default': self.has_default,
410 'strict': self.strict,
411 'line': self.line,
412 'column': self.column,
413 'type': self.type.serialize(),
414 }
415
416 @classmethod
417 def deserialize(cls, info: TypeInfo, data: JsonDict, api: SemanticAnalyzerPluginInterface) -> PydanticModelField:

Callers 1

transformMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected