Message110423
> 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. |
|
Date |
User |
Action |
Args |
2010-07-16 09:51:54 | pitrou | set | recipients:
+ pitrou, rhettinger, belopolsky, grubert, jackdied, alexandre.vassalotti, schmir, eric.araujo, zzzeek |
2010-07-16 09:51:53 | pitrou | set | messageid: <1279273913.77.0.546482512706.issue9269@psf.upfronthosting.co.za> |
2010-07-16 09:51:51 | pitrou | link | issue9269 messages |
2010-07-16 09:51:50 | pitrou | create | |
|