github pyozig/PyOZ v0.10.5
PyOZ v0.10.5

latest releases: v0.12.2, v0.12.1, v0.12.0...
5 months ago

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 ?*PyObject with automatic Py_IncRef on set() and Py_DecRef on clear() and object deallocation. Ref fields are automatically excluded from Python properties, __init__ parameters, stub generation, and auto-doc signatures. Freelist-safe: references are released in tp_dealloc before freelist push, and std.mem.zeroes on pop ensures no double-free.
  • Module.selfObject(T, ptr) helper - Recovers the wrapping *PyObject from a *const T data pointer using compile-time offset math. Used to obtain the PyObject needed for Ref(T).set() from within methods that receive self: *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

Don't miss a new PyOZ release

NewReleases is sending notifications on new releases.