(self, clz)
| 498 | ] |
| 499 | |
| 500 | def _get_field_names(self, clz): |
| 501 | if hasattr(clz, "__dict__"): |
| 502 | if dataclasses.is_dataclass(clz): |
| 503 | return [field.name for field in dataclasses.fields(clz)] |
| 504 | return sorted(self._type_hints.keys()) |
| 505 | if hasattr(clz, "__slots__"): |
| 506 | slots = clz.__slots__ |
| 507 | if isinstance(slots, str): |
| 508 | return [slots] |
| 509 | return sorted(slots) |
| 510 | return [] |
| 511 | |
| 512 | def _compute_unwrapped_hints(self): |
| 513 | return {field_name: unwrap_optional(hint)[0] for field_name, hint in self._type_hints.items()} |