Issue1745

classification
Title: interp.get(arr, Object) returns padded array if called arr.append(x)
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, judahgreenblatt
Priority: normal Keywords:

Created on 2011-05-02.18:12:27 by judahgreenblatt, last changed 2013-02-25.18:32:37 by fwierzbicki.

Messages
msg6519 (view) Author: Judah Greenblatt (judahgreenblatt) Date: 2011-05-02.18:12:27
Error happens when calling PythonInterpreter from Java.
Example Java code:

    interp = new PythonInterpreter();
    interp.put("arr", new double[3]);
    interp.exec("arr.append(3.0)\n\n");
    o = interp.get(arr, Object.class);

o ends up as double[7] with 3.0 in position 3.
Should be double[4].

Error is in PyArray.__toJava__(Class)
where it returns 'data' instead of calling this.getArray() which calls delegate.copyArray().
History
Date User Action Args
2013-02-25 18:32:37fwierzbickisetpriority: normal
nosy: + fwierzbicki
versions: + Jython 2.5, - 2.5.1
2011-05-02 18:12:27judahgreenblattcreate