Based on mypy.plugins.dataclasses.DataclassAttribute.to_var.
(
self,
current_info: TypeInfo,
api: SemanticAnalyzerPluginInterface,
use_alias: bool,
force_typevars_invariant: bool = False,
)
| 384 | return self.type |
| 385 | |
| 386 | def to_var( |
| 387 | self, |
| 388 | current_info: TypeInfo, |
| 389 | api: SemanticAnalyzerPluginInterface, |
| 390 | use_alias: bool, |
| 391 | force_typevars_invariant: bool = False, |
| 392 | ) -> Var: |
| 393 | """Based on mypy.plugins.dataclasses.DataclassAttribute.to_var.""" |
| 394 | if use_alias and self.alias is not None: |
| 395 | name = self.alias |
| 396 | else: |
| 397 | name = self.name |
| 398 | |
| 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.""" |
no test coverage detected