(cls: T, *args: Any, **kwargs: Any)
| 6 | class CastMixin: |
| 7 | @classmethod |
| 8 | def cast(cls: T, *args: Any, **kwargs: Any) -> T: |
| 9 | if len(args) == 1 and len(kwargs) == 0: |
| 10 | elem = args[0] |
| 11 | if elem is None: |
| 12 | return None # type: ignore |
| 13 | if isinstance(elem, CastMixin): |
| 14 | return elem # type: ignore |
| 15 | if isinstance(elem, tuple): |
| 16 | return cls(*elem) # type: ignore |
| 17 | if isinstance(elem, dict): |
| 18 | return cls(**elem) # type: ignore |
| 19 | return cls(*args, **kwargs) # type: ignore |
| 20 | |
| 21 | def __iter__(self) -> Iterator: |
| 22 | return iter(self.__dict__.values()) |
no outgoing calls
no test coverage detected