如何使用類型提示指定多個返回類型

| | | | | | | | |

我在 python 中有一個函數,它可以返回 boollist。有沒有辦法使用類型提示來指定返回類型。

例如,這是正確的方法嗎?

def foo(id) ->列表或布爾值:...