Typescript Infer Type From Array Python Question