Skip to content

Add bundled type stubs - #125

Open
heejaechang wants to merge 3 commits into
bastikr:masterfrom
heejaechang:heejaechang-complete-boolean-stubs
Open

Add bundled type stubs#125
heejaechang wants to merge 3 commits into
bastikr:masterfrom
heejaechang:heejaechang-complete-boolean-stubs

Conversation

@heejaechang

@heejaechang heejaechang commented Jul 27, 2026

Copy link
Copy Markdown

Summary

  • bundle PEP 561 stubs for the package and its shipped submodules
  • type the complete expression API, operators, parsing/token streams, substitutions, evaluation, instance fields, and custom algebra class injection
  • model parser AST/precedence structures recursively and expose successfully collected symbol objects as hashable
  • preserve opaque custom token-position payloads without changing production runtime behavior
  • add py.typed; the existing package-data configuration includes every typing artifact in wheels and sdists

Runtime boundary

Custom token positions are intentionally typed as object because documented alternative tokenizers pass through tuple or other opaque positions. The existing runtime stores these positions, but ParseError.__str__ compares them with an integer and can raise TypeError for non-integer values. This contribution records that mismatch without modifying runtime .py files.

Validation

  • pyright --verifytypes boolean --outputjson: 100% (239 known exports, 0 ambiguous/unknown; baseline was 0% with no py.typed)
  • python -m mypy.stubtest boolean: clean across all 3 shipped modules
  • positive Pyright and strict mypy fixtures: clean; adversarial fixture: all 10 invalid contracts rejected by both
  • tox -e py314: 86 passed, 4 expected xfails
  • bundled stubs pass Black and Black-profile isort checks
  • wheel and sdist build plus twine check: clean; both archives contain __init__.pyi, boolean.pyi, test_boolean.pyi, and py.typed
  • all production .py Git blobs match the original pre-typing baseline; packaged runtime files are byte-identical to the source checkout

heejaechang and others added 3 commits July 27, 2026 14:29
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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