What's NoneType in Python?

Find out what "NoneType" refers to in Python

In Python, "NoneType" is the data type for the built-in constant "None" (which implies absence of value). None is the only instance of the NoneType type:

print(type(None)) # <class 'NoneType'>

The NoneType is not available in some versions of Python (as noted below):

  • Python 2.7: NoneType is defined as a type in the types module;
  • Python 3.0 - 3.9: NoneType is removed from the types module (however, it's accessible via type(None));
  • Python 3.10: NoneType is added back to the types module.

Hope you found this post useful. It was published . Please show your love and support by sharing this post.