Update JPype 1.0.2, a library for accessing Java classes from Python.

Available new layer release JPype 1.0.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:

  • Method calls now include caching to avoid overload resolution, significantly reducing the performance overhead of method resolution, especially when the same overload is called multiple times, as during the execution of loops.
  • The transfer of lists, tuples, and buffers to Java primitive arrays has been accelerated from 4 to 100 times, depending on the data type. The conversion uses optimized in-memory buffer processing instead of the Sequence API. When encountering a Python buffer, only the first element is checked for conversion as the data buffers are homogeneous.
  • Shutdown operations handling (implemented back in JPype 1.0.0 but missed in the changelog). JPype now invokes the JVM shutdown procedure, which attempts to exit gracefully. This leads to some behavior changes. Non-background threads (proxy calls) can now keep the JVM open until they finish. Proxy calls will manage shutdown until the call is completed but will receive an interruption message. Files are now properly closed and data is flushed to disk if threads handle exceptions appropriately. Resource cleanup hooks and finalizers are executed. AtExit hooks are called when threads are spawned. Automatic thread joining via the daemon is implemented when using the JVM from Python. Erroneous code that cannot correctly handle thread cleanup is likely to hang during shutdown. Additional documentation is available in the usage guide.
  • The wrapper for Throwable received the wrapper for Object instead of the expected result, leading to strange conversions from Python classes.
  • Typos fixed in the import system causing the error '»jname» not found'.
  • Proper promotion of '^C' in KeyboardInterrupt is ensured.
  • Fixed an issue with characters from Python 3.5.3. PySlice_Unpack was introduced in the subsequent patch release (3.5.4) and should not have been used.
  • An error with numpy.linalg.inv causing crashes has been analyzed. The issue was traced to thread interaction between the JVM and certain numpy variants. The proposed solution is to call numpy.linalg.inv before starting the JVM.

Source: opennet.ru

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