我在 python 中有一個函數,它可以返回 bool 或 list。有沒有辦法使用類型提示來指定返回類型。
bool
list
例如,這是正確的方法嗎?
def foo(id) ->列表或布爾值:...