You should only use is with None. For there is and can only ever be one object of type NoneType. If a routine may return None, we know it isthe same constant None object used everywhere in Python.
That is if a==None and b==None then a is b. However, no such identity should be assumed for values other than None.
That can really cause some confusion. :)
Using
isand testing with small integers, only to later find out it fails with larger values.You should only use is with None. For there is and can only ever be one object of type NoneType. If a routine may return None, we know it isthe same constant None object used everywhere in Python.
That is if a==None and b==None then a is b. However, no such identity should be assumed for values other than None.
Followed and voted for Witness: thanks @emrebeyler for all cool things you do!
Have a happy day! ;)
very good idea.I also read your post.
I voted for you brother but never forget me when you will be a whale.
This post has received a 24.81 % upvote from @boomerang.
i vote you as a witnesses. plz upvote my comment