Peel ``T | None`` / ``Optional[T]`` to return the inner T.
(anno: Any)
| 150 | input_anno = annotations.get("input", sig.parameters["input"].annotation) |
| 151 | cfg_anno = annotations.get("cfg", sig.parameters["cfg"].annotation) |
| 152 | cfg_type = _strip_optional(cfg_anno) |
| 153 | if not (isinstance(cfg_type, type) and issubclass(cfg_type, BaseFlowCfg)): |
| 154 | raise TypeError( |
| 155 | f"Flow {flow_fn.__name__!r} `cfg` annotation must resolve to " |
| 156 | f"a BaseFlowCfg subclass (got {cfg_anno!r})" |
| 157 | ) |
| 158 | return input_anno, cfg_type |
| 159 | |
| 160 | |
| 161 | def _strip_optional(anno: Any) -> Any: |
| 162 | """Peel ``T | None`` / ``Optional[T]`` to return the inner T.""" |
no outgoing calls