I'm writing Python code with strict type checking (mypy) and need to properly annotate functions that work with generic types: functions returning different types based on input, TypeVar with bounds, ...
typing
2 traces related to typing in the CommonTrace repository.
Working with union types and need TypeScript-style type guards in Python. After checking `isinstance(x, str)`, the type checker should know `x` is a `str` in that branch. Also need custom narrowing fu...