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

Method serialize

mypy/plugins/attrs.py:187–204  ·  view source on GitHub ↗

Serialize this object so it can be saved and restored.

(self)

Source from the content-addressed store, hash-verified

185 return Argument(Var(name, init_type), init_type, None, arg_kind)
186
187 def serialize(self) -> JsonDict:
188 """Serialize this object so it can be saved and restored."""
189 return {
190 "name": self.name,
191 "alias": self.alias,
192 "has_default": self.has_default,
193 "init": self.init,
194 "kw_only": self.kw_only,
195 "has_converter": self.converter is not None,
196 "converter_init_type": (
197 self.converter.init_type.serialize()
198 if self.converter and self.converter.init_type
199 else None
200 ),
201 "context_line": self.context.line,
202 "context_column": self.context.column,
203 "init_type": self.init_type.serialize() if self.init_type else None,
204 }
205
206 @classmethod
207 def deserialize(

Callers 2

snapshot_definitionFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected