Hi Patrick, On Fri, Jun 10, 2022 at 12:42:16PM -0000, Patrick Arminio wrote:
```python def union( name: str, types: Tuple[Types, ...], * ) -> Union[Types]: # implementation is not important return None # type: ignore ```
I think the (non) implementation as shown is confusing. You surely don't actually return None? What do you do with the name, just ignore it? If you ignore the name, then it is hard for me to see why you need this union function at all. ```python UserOrError = User|Error # Or if you need to annotate it with additional information: UserOrError = Annotated[User|Error, "UserOrError"] ``` As Eric explains in another post, it is unlikely that static (compile-time) type checkers will support the evaluation and tracking of arbitrary types generated at runtime. Unfortunately subscripting syntax does not allow keyword arguments, so you cannot associate your annotation with a parameter name: ``` # This is a syntax error. Annotated[User|Error, name="UserOrError"] ``` See rejected PEP 637. -- Steve