(self: Instance)
| 368 | |
| 369 | |
| 370 | def convert_instance(self: Instance) -> Json: |
| 371 | ready = self.type is not NOT_READY |
| 372 | if not self.args and not self.last_known_value and not self.extra_attrs: |
| 373 | if ready: |
| 374 | return self.type.fullname |
| 375 | elif self.type_ref: |
| 376 | return self.type_ref |
| 377 | |
| 378 | data: dict[str, Any] = { |
| 379 | ".class": "Instance", |
| 380 | "type_ref": self.type.fullname if ready else self.type_ref, |
| 381 | "args": [convert_type(arg) for arg in self.args], |
| 382 | } |
| 383 | if self.last_known_value is not None: |
| 384 | data["last_known_value"] = convert_type(self.last_known_value) |
| 385 | data["extra_attrs"] = convert_extra_attrs(self.extra_attrs) if self.extra_attrs else None |
| 386 | return data |
| 387 | |
| 388 | |
| 389 | def convert_extra_attrs(self: ExtraAttrs) -> Json: |
no test coverage detected
searching dependent graphs…