(typ: type)
| 1194 | |
| 1195 | @functools.cache |
| 1196 | def _extra_args(typ: type) -> set[str]: |
| 1197 | import inspect |
| 1198 | |
| 1199 | sig = inspect.signature(typ) |
| 1200 | extras = set() |
| 1201 | for name, param in sig.parameters.items(): |
| 1202 | if param.kind in ( |
| 1203 | inspect.Parameter.VAR_POSITIONAL, |
| 1204 | inspect.Parameter.VAR_KEYWORD, |
| 1205 | ): |
| 1206 | continue |
| 1207 | if name in typ.get_all_slots(): # type: ignore |
| 1208 | extras.add(name) |
| 1209 | return extras |
no test coverage detected