Release JPype 0.7.2, a library for accessing Java classes from Python

Available release layer JPype 0.7.2, allowing full access for Python applications to Java class libraries. With JPype, you can use Java-specific libraries from Python, creating hybrid applications that combine Java and Python code. Unlike Jython, integration with Java is not achieved by creating a Python variant for the JVM but through interaction at the level of both virtual machines using shared memory. The proposed approach allows not only for good performance but also provides access to all CPython and Java libraries. The project code is distributed under the Apache 2.0 license.

Key Changes:

  • Exceptions thrown in C++ and Java code now provide a stack trace when an exception occurs in Python code. Thus, to obtain stack trace information, you no longer need to call stacktrace().
  • The return speed on calls has tripled.
  • Transmission speed has significantly increased (by orders of magnitude)
    for numpy buffers of multidimensional arrays. Multidimensional primitives transmit read-only copies created inside the JVM with contiguous C layout.
  • All exposed internal components have been replaced with implementations from CPython, and symbols __javaclass__, __javavalue__, and __javaproxy__
    have been removed. A dedicated Java slot has been added to all CPython types inherited from jpype class types. All private tables have been transferred to CPython. Java types must now inherit from the JClass metaclass, which uses type slots. Mixins for base Python classes are not allowed. Types Object, Proxy, Exception, Number, and Array directly inherit from the internal CPython implementations.
  • Improved tracing and exception handling.
  • Array slices are now handled as views that support reverse writing back to the original, such as a numpy array. Support for setting and retrieving values with a step (slice(start, stop, step)) is provided for array slices.
  • Support for __reversed__ has been implemented in arrays.
  • In Java arrays, support for the memoryview API has been added, and the dependency on numpy for transferring buffer contents has been removed.
  • Numpy is no longer a dependency (extra), and memory transfer to numpy is available without compilation with numpy support.
  • JInterface is now structured as a metaclass. Use isinstance(cls, JInterface) for interface checks.
  • The default imports have added the missing TLDs 'mil', 'net', and 'edu'.
  • Error messages during startup for UnsupportedClassVersion have been improved.
  • java.util.Map now raises KeyError if the element is not found. Values that are null still return None as expected. Use get() if empty keys are to be handled as None.
  • java.util.Collection has been removed, as it was oddly overloaded between remove(Object) and remove(int) on Lists. Use the Java method remove() to access the original Java behavior, but strict type casting is recommended to manage overloading.
  • java.lang.IndexOutOfBoundsException can now be caught using the IndexError exception class when accessing elements of java.util.List.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster