Use TypedDict dummy in place of recasts
Use TypedDict dummy in place of recasts

Mypy's --allow-redefinition flag does not yet work with classes. There are workarounds that trick Mypy, but this leaves Pylance with a Union between Dict[str, Any] and the actual TypedDict subclass, which makes any function annotated with this type incompatible with the required handler signature.

This solution always uses the TypedDict subclass, but reassigns the TypedDict name to equal the featureless "object" instead. That way inheritance works as intended and no typing_extensions dependency is required.
litl/backoff