Message110423
| Author |
pitrou |
| Recipients |
alexandre.vassalotti, belopolsky, eric.araujo, grubert, jackdied, pitrou, rhettinger, schmir, zzzeek |
| Date |
2010年07月16日.09:51:50 |
| SpamBayes Score |
1.6701617e-05 |
| Marked as misclassified |
No |
| Message-id |
<1279273913.77.0.546482512706.issue9269@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> The test case in cycle.py tricks set into accepting mutable objects by > creating a class with default __hash__. This falls into a category of > "don't do it".
I beg to differ. There is a reason we allow people to define __hash__ and that's to define arbitrary hashable types (not only immutable ones).
Furthermore, the default __hash__ (equivalent to id()) is also perfectly useful in some cases.
And in object-oriented designs it is very common to have reference cycles. |
|