from typing import Tuple
import struct


async def write_i32_list(l: Tuple[int, ...]) -> bytearray:
    """ Write `l` into bytes (int32 list). """
    ret = bytearray(struct.pack('<h', len(l)))

    for i in l:
        ret.extend(struct.pack('<i', i))

    return ret