Message1986
Some comments on the patch.
I think that it is a great idea to make the jython types more compatible with the common java types. This could be targeted in jython 2.5+, but it will probably follow with a number of other changes.
Some comments on the implementation in this patch:
This patch changes more than it is supposed to implement. What is the motivation behind making all parameters final?
containsValue : should, as the name implies, check if the Map contains a mapping with the argument as value, i.e. not as key, which is was __contains__ checks for.
entrySet : should return a set of Map.Entry objects, that is objects that contains both the key and the value. So we will probably use a loop to create these, or return our own specific set that creates these objects on the fly.
keySet : should return a set of the keys in the Map, the same as dict.keys() in python.
put: should return the old value associated with the key, so you'll need to __getitem__ it before you invoke __setitem__
putAll : this is actually quite simple to implement just iterate over arg0.entrySet() and add the key mapped to the value for each entry in that set.
remove : should remove the binding associated with the key, not associate it with null. Use __delitem__ here instead.
|
|
Date |
User |
Action |
Args |
2008-02-20 17:18:05 | admin | link | issue1816103 messages |
2008-02-20 17:18:05 | admin | create | |
|