Message9269
Objects that implement java.util.Set when proxied from Python should have standard set methods and semantics.
Making urgent: this fix needs to be in beta 4 because of the backwards breaking change in overriding remove so it has Python, not Java semantics, and raises KeyError if object is not present:
>>> from java.util import TreeSet
>>> x = TreeSet(xrange(0, 10, 2))
>>> x
[0, 2, 4, 6, 8]
>>> x.remove(9)
False # should raise KeyError
>>> x.remove(6)
True # should return None
>>> x.add(5)
True
>>> x
[0, 2, 4, 5, 8] # ordering is maintained, nice!
As usual, we expect the standard test suite in test_set will pass, with only a small number of changes.
Related and now fixed bugs include for java.util.Map (http://bugs.jython.org/issue1631) and java.util.List (http://bugs.jython.org/issue2215) |
|
Date |
User |
Action |
Args |
2014-12-27 17:21:39 | zyasoft | set | recipients:
+ zyasoft |
2014-12-27 17:21:39 | zyasoft | set | messageid: <1419700899.05.0.941563616998.issue2241@psf.upfronthosting.co.za> |
2014-12-27 17:21:39 | zyasoft | link | issue2241 messages |
2014-12-27 17:21:38 | zyasoft | create | |
|