Message3657

Author MrMeanie
Recipients MrMeanie
Date 2008-10-11.13:02:10
SpamBayes Score 4.060653e-09
Marked as misclassified No
Message-id <1223730131.88.0.0961195539054.issue1148@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-10-11 13:02:12MrMeaniesetrecipients: + MrMeanie
2008-10-11 13:02:11MrMeaniesetmessageid: <1223730131.88.0.0961195539054.issue1148@psf.upfronthosting.co.za>
2008-10-11 13:02:11MrMeanielinkissue1148 messages
2008-10-11 13:02:11MrMeaniecreate