from typing import Union my_list:list[Union[str,int]]=[1,2,"it",'it'] my_doc:dict[str,Union[str,int]]={'name':'周',"age":31} print(my_list,my_doc)