Skip to content

Conversation

@dlugoschvincent
Copy link

@dlugoschvincent dlugoschvincent commented Nov 8, 2025

pycapnp Type Stubs Added

Added complete, runtime-accurate type stubs with clean public API and hidden internals.

Structure

  • capnp/__init__.pyi: public re-exports
  • capnp/_internal.pyi: private TypeVars and Protocols
  • capnp/version.pyi: version info
  • capnp/lib/capnp.pyi: core class definitions
  • capnp/lib/__init__.pyi: package stub

Highlights

  • Exact module mapping, no false autocomplete entries
  • ~40 public symbols, internals hidden
  • MANIFEST.in includes all stubs

Example

import capnp
capnp.KjException
capnp.types.Int32
capnp.lib.capnp._EnumSchema  # internal

Result
Fully compatible, precise, and IDE-friendly type coverage for pycapnp. No runtime impact.

@dlugoschvincent dlugoschvincent changed the title feat: add stub file for static type checkers Add stub file for static type checkers Nov 8, 2025
@dlugoschvincent
Copy link
Author

Changing to draft as its being finalized.

@dlugoschvincent dlugoschvincent marked this pull request as ready for review November 8, 2025 06:28
@dlugoschvincent dlugoschvincent marked this pull request as draft November 8, 2025 06:34
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