Message10585
I'm trying to use ByteArrays in a dict and I get duplicated keys,
It appears that in Jython bytearray can be hashed (not in regular python 2.7) but the hash is not consistent with the equality operator:
>>> from array import array
>>> xs = [
array('b', [99, 111, 117, 110, 116, 45, 105, 116, 101, 109, 115]),
array('b', [99, 111, 117, 110, 116, 45, 105, 116, 101, 109, 115]),
array('b', [98, 121, 116, 101, 45, 115, 105, 122, 101])
]
>>> xs[0] == xs[1]
True
>>> xs[0] == xs[2]
False
>>> map(hash, xs)
[1363822052, 1722768342, 576563150] |
|
Date |
User |
Action |
Args |
2016-01-04 15:36:06 | lsenta | set | recipients:
+ lsenta |
2016-01-04 15:36:06 | lsenta | set | messageid: <1451921766.63.0.466045173289.issue2451@psf.upfronthosting.co.za> |
2016-01-04 15:36:06 | lsenta | link | issue2451 messages |
2016-01-04 15:36:06 | lsenta | create | |
|