github pyozig/PyOZ v0.13.4
PyOZ v0.13.4

2 hours ago

What's New in v0.13.4

Fixed

  • pyoz.func with a pyoz.Args(...) function could not be called. It compiled, but was registered as positional-only: keywords raised takes no keyword arguments and positional calls failed too. pyoz.func now detects pyoz.Args like .from and class methods do, so pyoz.kwfunc is optional.

  • Keyword functions ignored the module's .error_mappings. Errors from pyoz.kwfunc, and from .from functions taking pyoz.Args or optional ?T parameters, only used the built-in name-based fallback, so a mapped error surfaced as RuntimeError with the raw error name. They now use the same mappings as positional functions (new wrapFunctionWithNamedKeywordsAndErrorMapping and wrapAutoKeywordFunctionWithErrorMapping; the existing wrappers keep their signatures).

  • Constructors silently dropped keyword arguments. Diagnostic(1, 0, line=3) built an object with line = 0, and unknown keywords were accepted. Constructors now take keywords by name: the field names for the default constructor, and for __new__ the names from __new____params__ or pyoz.withSource. Duplicate, missing and unknown arguments raise TypeError, and a __new__ without known parameter names rejects keywords (Cls() takes no keyword arguments) instead of ignoring them.

  • Property getters returning pyoz.Signature(...) returned NULL without an exception (SystemError: error return without exception set): the wrapper was not unwrapped. All three getter kinds (get_X, custom field getters, pyoz.property) now unwrap it, map returned errors to exceptions, and always set an exception on failure.

  • Zig tuple parameters (struct { i64, i64 }) could be returned but not accepted: fromPy had no tuple case, so functions and __new__ taking one failed with a bare TypeError. They now accept a Python tuple of the same length, with clear errors for a wrong length or item type.

Changed

  • get_X / set_X are properties only with the accessor signature: get_X(self) and set_X(self, value). A function such as get_item(self, index) is now an ordinary method; previously it failed to compile with an error inside properties.zig. The rule lives in one place (class/accessors.zig) shared by the property table, the method table and stub generation.

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.4.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.