Nov-18-2023, 07:39 PM
(This post was last modified: Nov-18-2023, 07:40 PM by deanhystad.)
None is a singleton. There is only one None object. is/is not None checks if an object is the None object or not. Checking ihe value, which is what != does, is superfluous. No object other than None wiill == None.
In addition to None, True and False are singltons and you should never test ==True or == False, but rather is True or is False. Well, you should not do that either unless you really want to know if something is the True object or the False object.
In addition to None, True and False are singltons and you should never test ==True or == False, but rather is True or is False. Well, you should not do that either unless you really want to know if something is the True object or the False object.