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

标签 python negate negation isinstance

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

相关文章:

hadoop - Pig 如何处理否定空值?

python - 如何查找字符串是否包含不在另一个字符串中的字符

c - MISRA 警告 12.4 : integer conversion resulted in truncation (negation operation)

class - 如何否定 Cytoscape.js 中的类选择器?

Python:迭代元组时是否保留顺序?

python - 数据库查询优化

python - 基于 key 长度的字典性能

python - get_path() 从 matplotlib.patches 返回一个 Circle

regex - Perl正则表达式如何否定一个部分

java - -x 与 x * -1.0f 之间有区别吗?