is operator

castironpi at gmail.com castironpi at gmail.com
Mon Mar 10 13:10:07 EDT 2008


On Mar 10, 11:36 am, Steven D'Aprano <st... at REMOVE-THIS-
cybersource.com.au> wrote:
> On Mon, 10 Mar 2008 07:39:25 -0700, Gary Herron wrote:
> > If either is a surprise, then understand that the "is" operator should
> > probably *never* be used with immutable types.
>
> Mutable or immutable, it makes no difference: "is" is for testing
> identity, == is for testing equality. If you need to test for identity,
> use "is". If you need to test for equality, use ==.

What is the notion of equal defined for functions?



More information about the Python-list mailing list