Skip to content

v0.11.4: Signature stub override, PyMemoryView_Check, branch quota fix - #38

Merged
dzonerzy merged 4 commits into
mainfrom
dev
Feb 19, 2026
Merged

v0.11.4: Signature stub override, PyMemoryView_Check, branch quota fix#38
dzonerzy merged 4 commits into
mainfrom
dev

Conversation

@dzonerzy

Copy link
Copy Markdown
Collaborator

Changes

Added

  • pyoz.Signature(T, "python_type") for overriding .pyi stub return type annotations without affecting runtime behavior
  • PyMemoryView_Check type check function (stable ABI compatible)

Fixed

  • Comptime branch quota exceeded with large modules in anyFuncUsesDateTime/anyFuncUsesDecimal

Refactored

  • Type check functions now use shared isTypeOrSubtype helper
  • Replaced method__returns__ convention with unified Signature approach

Docs

  • Updated guide/stubs.md, guide/classes.md, guide/functions.md, reference/api.md

Adds a unified mechanism to override .pyi stub return type annotations
while preserving runtime behavior. Replaces the old __returns__ pattern.

- Add Signature comptime wrapper type and unwrapSignature in root.zig
- Add unwrapSignatureValue for runtime value unwrapping
- Update all call sites: wrappers, callable, methods, lifecycle, gil
- Update stubs.zig to detect and use Signature annotations
- Add validate_positive_sig example function
- Add runtime + stub verification tests
- Update docs: guide/stubs.md, guide/classes.md, guide/functions.md,
  reference/api.md
- Bump version to 0.11.4
…ubtype helper

Add PyMemoryView_Check using PyMemoryView_Type (stable ABI since 3.2).
Refactor PySet_Check, PyFrozenSet_Check, PyBytes_Check, PyByteArray_Check,
and PyObject_TypeCheck to use the shared isTypeOrSubtype helper for
consistency.
Modules with many functions would fail to compile with 'evaluation
exceeded 1000 backwards branches' in anyFuncUsesDateTime/anyFuncUsesDecimal.
Use std.math.maxInt(u32) to remove the limit entirely.
@dzonerzy
dzonerzy merged commit 2535170 into main Feb 19, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant