我将如何使用 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/