Return the Attribute that was serialized.
(
cls, info: TypeInfo, data: JsonDict, api: SemanticAnalyzerPluginInterface
)
| 205 | |
| 206 | @classmethod |
| 207 | def deserialize( |
| 208 | cls, info: TypeInfo, data: JsonDict, api: SemanticAnalyzerPluginInterface |
| 209 | ) -> Attribute: |
| 210 | """Return the Attribute that was serialized.""" |
| 211 | raw_init_type = data["init_type"] |
| 212 | init_type = deserialize_and_fixup_type(raw_init_type, api) if raw_init_type else None |
| 213 | raw_converter_init_type = data["converter_init_type"] |
| 214 | converter_init_type = ( |
| 215 | deserialize_and_fixup_type(raw_converter_init_type, api) |
| 216 | if raw_converter_init_type |
| 217 | else None |
| 218 | ) |
| 219 | |
| 220 | return Attribute( |
| 221 | data["name"], |
| 222 | data["alias"], |
| 223 | info, |
| 224 | data["has_default"], |
| 225 | data["init"], |
| 226 | data["kw_only"], |
| 227 | Converter(converter_init_type) if data["has_converter"] else None, |
| 228 | Context(line=data["context_line"], column=data["context_column"]), |
| 229 | init_type, |
| 230 | ) |
| 231 | |
| 232 | def expand_typevar_from_subtype(self, sub_type: TypeInfo) -> None: |
| 233 | """Expands type vars in the context of a subtype when an attribute is inherited |
no test coverage detected