[Improvement]: accept collections.abc.Iterable[T] as a type hint
Open
core
new feature
P2
python
types
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
### What happened?
Trying to use typing.Iterable[T] in Beam code works fine, but collections.abc.Iterable[T] does not.
I imagine that the special casing of the typing module should be extended to collections.abc as well.
```python
print(typehints.is_consistent_with(Iterable[str], Iterable[Any]))
> True
print(typehints.is_consistent_with(collections.abc.Iterable[str], Iterable[Any]))
> False
print(typehints.is_consistent_with(collections.abc.Iterable[str], collections.abc.Iterable[Any]))
> TypeError: issubclass() argument 2 cannot be a parameterized generic
```
### Issue Priority
Priority: 2
### Issue Component
Component: sdk-py-core
Contributor guide
Assessment
This issue has not been assessed yet.