On 6 Nov, 14:35, "Alf P. Steinbach" <al...@start.no> wrote:

> As I understand it, 'is' will always work and will always be efficient (it 
> just
> checks the variable's type), while '==' can depend on the implementation of
> equality checking for the other operand's class.

'==' checks for logical equality. 'is' checks for object identity.

None is a singleton of type NoneType. Since None evaluates to True
only when compared against itself, it is safe to use both operators.









-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to