Message11251

Author jeff.allen
Recipients jamesmudd, jeff.allen, stefan.richthofer, zyasoft
Date 2017-03-20.08:36:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489998966.54.0.862736289899.issue2399@psf.upfronthosting.co.za>
In-reply-to
Content
@James: I think you've identified yourself the drawbacks of useLegacyMergeSort and keeping a copy of the original list. Ok as a user workaround I think.

I haven't found a Java bug report that encapsulates our issue. Maybe your Java example makes it possible to raise one? It's more an enhancement really, as nothing is promised.

I was hinting at another option. I was thinking that around here:
https://hg.python.org/jython/file/tip/src/org/python/core/PyList.java#l812
and here:
https://hg.python.org/jython/file/tip/src/org/python/core/PyList.java#l864
since we have to provide a Comparator that wraps the __lt__ or custom Python comparator for Java, we could easily catch the exception, and return to TimSort an acceptable result (e.g. claim equality). This would probably let TimSort complete, or at least finish the merge. (Might get an "inconsistent with equals" exception?) Obviously the order of the result is not meaningful now, but it contains all its original elements, as we seem to want.

But we can't just lose the exception: so we'd have to squirrel it away (as a member of the comparator object, say), for PyList.sort to pick up and throw when the Java library returns.

You've put some good work into this bug already, and I don't have much time for Jython before next weekend. If you thought this an approach you could make work, I'd be happy to see you run with it.
History
Date User Action Args
2017-03-20 08:36:06jeff.allensetmessageid: <1489998966.54.0.862736289899.issue2399@psf.upfronthosting.co.za>
2017-03-20 08:36:06jeff.allensetrecipients: + jeff.allen, zyasoft, stefan.richthofer, jamesmudd
2017-03-20 08:36:06jeff.allenlinkissue2399 messages
2017-03-20 08:36:05jeff.allencreate