Python type hints: support constrained TypeVars
Open
bug
core
P3
python
types
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
Support the following syntax when converting to internal Beam types,
and raise a TypeCheckError when trying to bind anything that isn't Any, one of the listed types, or a subtype of the listed types.
```
AnyStr = TypeVar('AnyStr', Text, bytes)
```
See: https://www.python.org/dev/peps/pep-0484/#generics (lots of cases to check)
Imported from Jira [BEAM-10690](https://issues.apache.org/jira/browse/BEAM-10690). Original Jira may contain additional context.
Reported by: udim.
Contributor guide
Assessment
This issue has not been assessed yet.