2014-08-19 0:04 GMT+02:00 Chris Kaynor <ckay...@zindagigames.com>: > > On Mon, Aug 18, 2014 at 2:42 PM, Ethan Furman <et...@stoneleaf.us> wrote: >> >> If you are not dealing with singletons (which is most cases), such as >> numbers, strings, lists, and most other arbitrary objects, you will need to >> use "!=" or anytime the two objects you are comparing are not the exact same >> object, you can easily get the wrong answer. > > > For example, in CPython 3.4.1: >>>> (254 + 3) is 257 > False >>>> (254 + 3) == 257 > True >>>> ('asd' + '@sd') is 'asd@sd' > False >>>> ('asd' + '@sd') == 'asd@sd' > True
Now you have managed to confuse this newbie: What would a valid "is-example" look like? Regards, Martin S -- https://mail.python.org/mailman/listinfo/python-list