Message78059
As reported by Dmitry Vasiliev on python-dev, a range object suddenly
becomes hash()able after an attribute access, e.g. by dir().
If I understand correctly, then the reason is that PyRange_Type doesn't
set tp_hash and PyType_Ready is not normally called on the type, but
only e.g. in PyObject_GenericGetAttr.
I don't see any use for range objects being hashable, as they don't even
have meaningful equality defined on them. So I'd recommend making them
unhashable. The attached patch does this and adds a test. |
|
Date |
User |
Action |
Args |
2008-12-19 15:21:11 | hagen | set | recipients:
+ hagen |
2008-12-19 15:21:11 | hagen | set | messageid: <1229700071.49.0.411961185177.issue4701@psf.upfronthosting.co.za> |
2008-12-19 15:21:10 | hagen | link | issue4701 messages |
2008-12-19 15:21:09 | hagen | create | |
|