除了“None"之外,Python 中还有什么是“NoneType"的吗? [英] Is there anything in Python that is a `NoneType` besides `None`?

查看:69
本文介绍了除了“None"之外,Python 中还有什么是“NoneType"的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道在 Python 中,除了众所周知的 None 之外,是否还有其他类型为 NoneType 类型的对象/实例:

<预><代码>>>>类型(无)<输入'NoneType'>

所以...这很清楚,但我想知道是否还有 anything 也是 NoneType

<预><代码>>>>类型(???)<输入'NoneType'>

不用说,这只是出于好奇和学习目的:-)

提前致谢.

解决方案

来自文档,None 是:

<块引用>

NoneType 类型的唯一值.

I was just wondering if in Python there's any other object/instance whose type is NoneType type besides the very well known None:

>>> type(None)
<type 'NoneType'>

So... This is very clear, but I was wondering whether there's anything else that is also of NoneType

>>> type(???)
<type 'NoneType'>

Needless to say, this is just for curiosity sake and learning purposes :-)

Thank you in advance.

解决方案

From the docs, None is:

The sole value of the type NoneType.

这篇关于除了“None"之外,Python 中还有什么是“NoneType"的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆