Home > Article > Backend Development > none and null in python
1. Python objects
To understand this, you must first understand Python objects:
Python objects have three characteristics: identity, type, and value.
Three properties are assigned when the object is created. Only the value can be changed, others are read-only.
The type itself is also an object.
2. Null and None
is a special type of Python, Null object or None Type, it has only one value None.
It does not support any operations and does not have any built-in methods.
None and any other data Type comparisons always return False.
None has its own data type NoneType.
You can copy None to any variable, but you cannot create other NoneType objects.
Copy code
>>> type(None)
>>> None == 0
False
>>> None == ' '
False
>>> None == None
True
>>> None == False
False