Message152254
| Author |
catalin.iacob |
| Recipients |
catalin.iacob, docs@python |
| Date |
2012年01月29日.19:58:51 |
| SpamBayes Score |
7.0345183e-09 |
| Marked as misclassified |
No |
| Message-id |
<1327867132.3.0.913390477966.issue13905@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
In 2.7 the Comparisons section of stdtypes.rst only talks about __cmp__ and never mentions the rich comparison methods:
"Instances of a class normally compare as non-equal unless the class defines the __cmp__() method. Refer to Basic customization) for information on the use of this method to effect object comparisons."
The first sentence is false, instances can also compare as equal if they define __eq__. And since __cmp__ is gone in Python3, I think the rich comparison methods should at least be mentioned, or even emphasized over __cmp__ to help people write more forward compatible code. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年01月29日 19:58:52 | catalin.iacob | set | recipients:
+ catalin.iacob, docs@python |
| 2012年01月29日 19:58:52 | catalin.iacob | set | messageid: <1327867132.3.0.913390477966.issue13905@psf.upfronthosting.co.za> |
| 2012年01月29日 19:58:51 | catalin.iacob | link | issue13905 messages |
| 2012年01月29日 19:58:51 | catalin.iacob | create |
|