PyOZ v0.11.4
What's New in v0.11.4
Added
pyoz.Signature(T, "python_type")-- stub return type override - New comptime wrapper type that overrides the Python type annotation in generated.pyistubs without affecting runtime behavior. Use this when the Zig return type doesn't map cleanly to the desired Python type, most commonly when?Tis used for CPython exception signaling (returningnull+PyErr_SetString) rather than representing PythonNone. For example,fn probe() pyoz.Signature(?Dict, "dict[str, bool]")generatesdef probe() -> dict[str, bool]instead of the incorrectdef probe() -> dict[str, bool] | None. Also supportspyoz.Signature(?void, "Never")for functions that only raise. Works uniformly on module-level functions, class instance/static/class methods,__call__,__new__, andallowThreads/allowThreadsTry.PyMemoryView_Check- Added type check function formemoryviewobjects, following the sameisTypeOrSubtypepattern as other type checks. UsesPyMemoryView_Typewhich is part of the stable ABI since Python 3.2, so works across 3.8–3.13 in both normal and ABI3 modes.
Fixed
- Comptime branch quota exceeded with large modules - Modules with many functions would fail to compile with
evaluation exceeded 1000 backwards branchesinanyFuncUsesDateTime/anyFuncUsesDecimal. Fixed by setting@setEvalBranchQuota(std.math.maxInt(u32))in both functions.
Refactored
- Type check functions -
PySet_Check,PyFrozenSet_Check,PyBytes_Check,PyByteArray_Check, andPyObject_TypeChecknow use the sharedisTypeOrSubtypehelper for consistency.
Removed
method__returns__class method stub override - Thepub const method_name__returns__: []const u8 = "..."convention for overriding class method return type stubs has been removed in favor of the unifiedpyoz.Signature(T, "python_type")approach, which works identically for both module-level functions and class methods.
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.11.4.tar.gz for the source code.
Quick Start
pyoz init mymodule
cd mymodule
pyoz build
pip install dist/*.whl