Message3657
List behavior
=============
The behavior of lists in Jython differes from CPython when setting
slices in some cases.
Example:
CPython:
>>> x = range(0,10)
>>> x[-9:-12:-1] = range(0,2)
>>> x
[1, 0, 2, 3, 4, 5, 6, 7, 8, 9]
Jython 2.5a3 and latests SVN:
>>> x = range(0,10)
>>> x[-9:-12:-1] = range(0,2)
>>> x
[0, 1, 2, 3, 4, 5, 6, 7, 1, 0]
This is fixed in the attached patch, which modifies org.python.core.PyList.
CollectionProxy behavior
========================
The ListProxy class maps python subscript operators to underlying Java
List. However, it only supports positive integer indices.
The attached patch also contains changes to ListProxy which allow
negative integer indices, and the use of slices.
This is tested by the 'test_CollectionProxy.py' file which is included. |
|
Date |
User |
Action |
Args |
2008-10-11 13:02:12 | MrMeanie | set | recipients:
+ MrMeanie |
2008-10-11 13:02:11 | MrMeanie | set | messageid: <1223730131.88.0.0961195539054.issue1148@psf.upfronthosting.co.za> |
2008-10-11 13:02:11 | MrMeanie | link | issue1148 messages |
2008-10-11 13:02:11 | MrMeanie | create | |
|