Re: Does the "is" operator only matter for mutable object?
Steven D'Aprano <[email protected]> Sat, 05 Mar 2011 14:13:53 +1100
| Newsgroups | gmane.comp.python.documentation |
|---|---|
| Message-ID | <[email protected]> |
INADA Naoki wrote: > In > http://docs.python.org/py3k/tutorial/datastructures.html#comparing-sequences-and-other-types > , > > The operators is and is notcompare whether two objects are really the same >> object; >> this only matters for mutable objects like lists. > > > I think this notation may confuse readers of the tutorial. For example, pep8 > recommands > using is operator for immutable singleton objects like None. > > Shall we remove letter part? Rather than completely remove it, I would reword it: The operators is and is not compare whether two objects are really the same object; this usually only matters for mutable objects like lists, or for testing against singletons like None. -- Steven _______________________________________________ Doc-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/doc-sig