What's New in v0.13.5
Added
__new__can takepyoz.Args(...). The constructor then accepts keywords and defaults from the argument struct, like keyword functions, with no__new____params__and nopyoz.withSource:pub fn __new__(args: pyoz.Args(struct { level: i64, line: i64 = 0 })) Notice.- Field defaults in the default constructor. A field with a default value may be omitted: with
struct { width: i64, height: i64 = 10 },Options(3)andOptions(3, height=4)both work. A required field after a defaulted one can be passed by keyword.
Fixed
__init__stubs ignored__new__. The.pyialways listed the struct's public fields, so a class with a custom constructor got the wrong signature (def __init__(self)when all fields are private). Stubs now describe the real constructor: thepyoz.Argsfields, or the__new__parameters with their names when known (arg0, ..., /otherwise) and| None = Nonefor optional ones. Field defaults appear as= ....
Changed
- Constructor error messages follow one format for every constructor kind:
Cls() takes at most N positional arguments (M given),Cls() missing required argument 'x',Cls() argument 'x' has the wrong type.
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.5.tar.gz for the source code.
Quick Start
pyoz init mymodule
cd mymodule
pyoz build
pip install dist/*.whl