相关疑难解决方法(0)

位于Python 3.x中的NoneType在哪里?

在Python 3中,我想检查value是字符串还是字符串None.

一种方法是

assert type(value) in { str, NoneType }
Run Code Online (Sandbox Code Playgroud)

但是NoneTypePython的位置在哪里?

没有任何导入,使用NoneType产品NameError: name 'NoneType' is not defined.

python types python-3.x nonetype

24
推荐指数
2
解决办法
8965
查看次数

标签 统计

nonetype ×1

python ×1

python-3.x ×1

types ×1