Possible Duplicate:
String comparison in Python: is vs. ==
When is the==operator not equivalent to theisoperator? (Python)
I'm pretty new to Python still. I heard someone say use is, not == because "this isn't C". But I had some code x is 5 and it was not working as expected.
So, following proper Python/PEP style, when is the time to use is and when is the time to use == ?
isvs==isis for testing None. Otherwise default to==is, not==" is flat wrong and you should take any other advice they give with a grain of salt. You almost never need to useisin Python.