Issue1798544

classification
Title: patch for [ 1791931 ] slice be a type
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, rajesh_battala
Priority: normal Keywords: patch

Created on 2007-09-20.05:49:28 by rajesh_battala, last changed 2007-12-02.07:22:19 by cgroves.

Files
File name Uploaded Description Edit Remove
newstyle_slice_patch.diff rajesh_battala, 2007-10-23.07:40:58 patch file
Messages
msg2886 (view) Author: rajesh battala (rajesh_battala) Date: 2007-09-20.05:49:28
hi all.
i have fixed the bug. i am attaching the patch.
msg2887 (view) Author: Charlie Groves (cgroves) Date: 2007-09-24.05:57:58
Is there any reason you didn't make this a newstyle type with a .expose and .derived?  If we're going to switch this to be a type, I'd like to make that upgrade at the same time.
msg2888 (view) Author: rajesh battala (rajesh_battala) Date: 2007-09-27.07:04:49
hi charlie
i have done Slice with the New style clases.
i am attaching the patch.
thanks.

File Added: new_style_slice.diff
msg2889 (view) Author: Charlie Groves (cgroves) Date: 2007-09-30.01:26:42
The code in PySliceDerived.java in this patch is different from the code that is generated by running gderived.py on the included slice.derived.  With the included PySliceDerived, PySlice.java doesn't compile as its new is expecting a different constructor on PySliceDerived.  To make a different constructor in a derived class, you need to modify the ctr: line in the .derived file.  Look at str.derived.  You should also modify the mappings file in src/templates so python gderived.py slice.derived and python gexpose.py slice.expose work.

The slice type has a method indices and fields start, stop and step in CPython.  This patch needs to add those.  In particular, test_slice.py does some tests on indices which blow up with this patch in place.  We should be able to remove test_slice from the failures list in regrtest.py after this patch is applied.  It'd be nice to add some tests for start, stop and step in test_slice as well.

The duplicated code in each of the PySlice constructors and the init method is also fairly disturbing.  They're all doing the same thing, so it should be done in a single place.  Unnecessarily duplicated code is one of the most evil substances in the universe.

Finally, I think Philip may have already mentioned this, but just in case, we're going for all spaces in Jython's source.  No tabs.
msg2890 (view) Author: rajesh battala (rajesh_battala) Date: 2007-10-23.07:40:58
hi groves.

i have implemented the indices method.
i have got one problem.i have filed the bug against that.
and commented out one case in the test file  test_slice.py(i have taken it from python 2.4)




File Added: newstyle_slice_patch.diff
msg2891 (view) Author: Charlie Groves (cgroves) Date: 2007-12-02.07:22:19
Committed in r3749.  I had to fix test failures in regrtest because PySlice wasn't handling null values in its constructor.  Please run all of regrtest before submitting patches in the future.

I also fixed the bug you filed against this patch.  It'd be better to refrain from opening bugs for things until they're actually in svn.
History
Date User Action Args
2007-09-20 05:49:28rajesh_battalacreate