What's New in v0.13.6
Added
pyoz.asyncThen(f, then)andpyoz.asyncMethodThen(f, then): async functions with a completion step. The task still runs without Python; when it succeeds,then(result, extra...)runs on the event loop thread with Python attached, and the awaitable resolves to its result.then's extra parameters follow the task's in the Python signature and may be*pyoz.PyObject/?*pyoz.PyObject, which PyOZ keeps alive until the step has run (and releases on cancellation). This covers work such asawait compile_async(grammar, classes=module), where the compiled result must be bound to Python objects.pyoz.func(...).withParams(...)makes?Tparameters optional. When the names cover every parameter, the optional ones may be omitted or passed by keyword, as.fromfunctions already allowed. Before, every argument had to be passed positionally.
Fixed
- Async results that never reached Python were dropped without cleanup. When an awaitable was cancelled after its task had finished (or while the task ignored cancellation), or the event loop was closed, the task's result was discarded: a PyOZ class returned by value never had
__del__run, and a returned*pyoz.PyObjectleaked its reference. PyOZ now releases such results once the task has been joined. This applies toasyncFn,asyncMethodand the newasyncThen.
Installation
Download the binary for your platform and add it to your PATH:
| Platform | Binary |
|---|---|
| Linux x86_64 | pyoz-x86_64-linux
|
| Linux ARM64 | pyoz-aarch64-linux
|
| macOS x86_64 | pyoz-x86_64-macos
|
| macOS ARM64 (Apple Silicon) | pyoz-aarch64-macos
|
| Windows x86_64 | pyoz-x86_64-windows.exe
|
| Windows ARM64 | pyoz-aarch64-windows.exe
|
Source
Download PyOZ-0.13.6.tar.gz for the source code.
Quick Start
pyoz init mymodule
cd mymodule
pyoz build
pip install dist/*.whl