You are viewing a single comment's thread from:

RE: Python gotcha - "is" operator on integers

in #python6 years ago (edited)

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.

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 59364.81
ETH 2658.44
USDT 1.00
SBD 2.49