Код: Выделить всё
def map_cast(T, seq: Sequence) -> Sequence[T]:
"""Cast a sequence of elements to a sequence of elements of given type."""
return [cast(T, x) for x in seq]
Подробнее здесь: https://stackoverflow.com/questions/793 ... -in-python
Код: Выделить всё
def map_cast(T, seq: Sequence) -> Sequence[T]:
"""Cast a sequence of elements to a sequence of elements of given type."""
return [cast(T, x) for x in seq]