jpype v0.7.3 Release Notes

Release Date: 2020-04-21 // over 1 year ago
  • ๐Ÿš€ This is a maintenance release correcting a number of issues from NumPy removal. Yet another stepping stone on the way to 1.0.

    Replaced type management system , memory management for internal
    classes is now completely in Java to allow enhancements for
    ๐Ÿ‘ buffer support and revised type conversion system.

    ๐Ÿš€ Python module jpype.reflect will be removed in the next release.

    0๏ธโƒฃ jpype.startJVM option convertStrings default will become False
    ๐Ÿš€ in the next release.

    ๐Ÿ‘ท Undocumented feature of using a Python type in JObject(obj, type=tp)
    ๐Ÿ—„ is deprecated to support casting to Python wrapper types in Java in a
    ๐Ÿš€ future release.

    โฌ‡๏ธ Dropped support for Cygwin platform.

    JFloat properly follows Java rules for conversion from JDouble.
    Floats outside of range map to inf and -inf.

    java.lang.Number converts automatically from Python and Java numbers.
    Java primitive types will cast to their proper box type when passed
    to methods and fields taking Number.

    java.lang.Object and java.lang.Number box signed, sized numpy types
    (int8, int16, int32, int64, float32, float64) to the Java boxed type
    with the same size automatically. Architecture dependent numpy
    types map to Long or Double like other Python types.

    Explicit casting using primitives such as JInt will not produce an
    OverflowError. Implicit casting from Python types such as int or float
    will.

    Returns for number type primitives will retain their return type
    information. These are derived from Python int and float types
    thus no change in behavior unless chaining from a Java methods
    which is not allowed in Java without a cast.
    JBoolean and JChar still produce Python types only.

    โž• Add support for direct conversion of multi-dimensional primitive arrays
    with JArray.of(array, [dtype=type])

    java.nio.Buffer derived objects can convert to memoryview if they
    are direct. They can be converted to NumPy arrays with
    numpy.asarray(memoryview(obj)).

    Proxies created with @JImplements properly implement toString,
    hashCode, and equals.

    Proxies pass Python exceptions properly rather converting to
    java.lang.RuntimeException

    JProxy.unwrap() will return the original instance object for proxies
    created with JProxy. Otherwise will return the proxy.

    JProxy instances created with the convert=True argument will automatic
    unwrap when passed from Java to Python.

    JProxy only creates one copy of the invocation handler per
    garbage collection rather than once per use. Thus proxy objects
    placed in memory containers will have the same object id so long
    as Java holds on to it.

    @JImplements with keyword argument deferred can be started
    prior to starting the JVM. Methods are checked at first object
    creation.

    ๐Ÿ›  Fix bug that was causing java.lang.Comparable, byte[],
    and char[] to be unhashable.

    ๐Ÿ›  Fix bug causing segfault when throwing Exceptions which lack a
    0๏ธโƒฃ default constructor.

    ๐Ÿ›  Fixed segfault when methods called by proxy have incorrect number of
    arguments.

    ๐Ÿ›  Fixed stack overflow crash on iterating ImmutableList

    java.util.Map conforms to Python collections.abc.Mapping API.

    java.lang.ArrayIndexOutOfBoundsException can be caught with
    ๐Ÿ‘ป IndexError for consistency with Python exception usage.

    java.lang.NullPointerException can be caught with ValueError
    ๐Ÿ‘ป for consistency with Python exception usage.

    Replaced type conversion system , type conversions test conversion
    once per type improving speed and increasing flexiblity.

    ๐Ÿ‘‰ User defined implicit conversions can be created with @JConversion
    decorator on Python function taking Java class and Python object.
    Converter function must produce a Java class instance.

    pathlib.Path can be implicitly converted into java.lang.File
    and java.lang.Path.

    datetime.datatime can implicitly convert to java.time.Instant.

    dict and collections.abc.Mapping can convert to java.util.Map
    if all element are convertable to Java. Otherwise, TypeError is
    raised.

    list and collections.abc.Sequence can convert to java.util.Collection
    if all elements are convertable to Java. Otherwise, TypeError is
    raised.