if variable is None:
Note: if you declare two or more variables with the value None, they will refer to the same NoneType object.
How to check NoneType in Python
A simple example code determining a variable’s type is NoneType in Python.
x = None if x is None: print(x) print(type(x)) else: print("X is not None")
Do comment if you have any doubts or suggestions on this Python NoneType topic.
Note: IDE: PyCharm 2021.3.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.