What's New in v0.10.5
Added
pyoz.Ref(T)-- strong Python object references - New generic type that allows one PyOZ-managed Zig struct to hold a strong reference to another Python object, preventing use-after-free when the referenced object is garbage collected.Ref(T)wraps a?*PyObjectwith automaticPy_IncRefonset()andPy_DecRefonclear()and object deallocation. Ref fields are automatically excluded from Python properties,__init__parameters, stub generation, and auto-doc signatures. Freelist-safe: references are released intp_deallocbefore freelist push, andstd.mem.zeroeson pop ensures no double-free.Module.selfObject(T, ptr)helper - Recovers the wrapping*PyObjectfrom a*const Tdata pointer using compile-time offset math. Used to obtain the PyObject needed forRef(T).set()from within methods that receiveself: *const T.
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.10.5.tar.gz for the source code.
Quick Start
pyoz init mymodule
cd mymodule
pyoz build
pip install dist/*.whl