M
mk
Hello,
Some claim that one should test for None using:
if x is None:
...but the standard equality which is theoretically safer works as well:
if x == None:
So, which one is recommended?
Can there be two None objects in interpreter's memory? Is testing for
identity of some variable with None safe? Does language guarantee that?
Or is it just property of implementation?
Regards,
mk
Some claim that one should test for None using:
if x is None:
...but the standard equality which is theoretically safer works as well:
if x == None:
So, which one is recommended?
Can there be two None objects in interpreter's memory? Is testing for
identity of some variable with None safe? Does language guarantee that?
Or is it just property of implementation?
Regards,
mk