How do you in Python typehint a list of union of two classes as a argument

后端 未结 0 1841
离开以前
离开以前 2021-01-31 09:41

I am trying to create a function that accepts a list of mammels or a list of animals as an arg.

This is my code

from typing import Union, List
class Animal         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题