Ben Finney ben+python at
Mon Mar 3 22:10:21 CET 2014

Rustom Mody <rustompmody at> writes:

> Short answer: Avoid using 'is'. 

This is bad advice in a Python forum.

The ‘is’ operator is commonly used in Python, so please don't advise
against it in an unqualified “short answer”.

> Long answer:

Interesting, but mostly a distraction for the querent here.

Short answer: Use ‘use’ any time you need to compare object identity.
You usually do not need to compare object identity.

 \        “Some people, when confronted with a problem, think ‘I know, |
  `\       I'll use regular expressions’. Now they have two problems.” |
_o__)                           —Jamie Zawinski, in alt.religion.emacs |
Ben Finney

More information about the Python-list mailing list