gpt4 book ai didi

python - Python 中 isinstance() 的否定形式

转载 作者:太空狗 更新时间:2023-10-29 17:01:23 25 4
gpt4 key购买 nike

我将如何使用 Python 的 isinstance() 的否定形式?

通常否定会像这样工作

x != 1

if x not in y

if not a

我还没有看到 isinstance() 的例子,所以我想知道是否有正确的方法来使用 isinstance() 的否定。

最佳答案

只需使用而不是isinstance 只返回一个 bool,您可以像其他任何东西一样。

关于python - Python 中 isinstance() 的否定形式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11748671/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com