3 ms·
Yup. There is a Generic type which uses duck typing and has an `Iterable` subclass for classes implementing __iter__() (https://docs.python.org/3/library/typin
by Leynos 10y ago
Yup. There is a Generic type which uses duck typing and has an `Iterable` subclass for classes implementing __iter__() (https://docs.python.org/3/library/typing.html#typing.Generic https://docs.python.org/3/library/typing.html#typing.Generic). It has been pointed out though that `str` counts as an instance of Iterable[str], so there is a possibility for some amusing issues to arise from this.