Skip to content

optimize typing#37

Open
district10 wants to merge 4 commits into
devfrom
tzx/260604-1
Open

optimize typing#37
district10 wants to merge 4 commits into
devfrom
tzx/260604-1

Conversation

@district10

Copy link
Copy Markdown
Member

No description provided.

zhixiong-tang and others added 4 commits June 4, 2026 11:38
Covers GeoJSON/Geobuf/GeobufIndex APIs with emphasis on non-obvious
patterns such as the __call__() conversion convention, the
properties()() double-call idiom, mutable vs copy numpy views, and
the two-step GeobufIndex workflow for large-file random access.

Co-Authored-By: Claude Sonnet 4 (1M context) <noreply@anthropic.com>
`from ._core import *` does not make submodules visible to Pyright/Pylance,
so `from pybind11_geobuf import geojson` had no completions while
`from pybind11_geobuf._core import geojson` worked fine.

Using `import X as X` signals an intentional public re-export per PEP 484,
making both import paths equivalent for type checkers.

Co-Authored-By: Claude Sonnet 4 (1M context) <noreply@anthropic.com>
Use `import X as X` for every name in _core.__all__ so Pyright/Pylance
recognises them as intentional public re-exports from pybind11_geobuf,
not just transient wildcard imports.

Co-Authored-By: Claude Sonnet 4 (1M context) <noreply@anthropic.com>
The X as X re-export pattern is required by type checkers (PEP 484)
but triggers pylint/ruff PLC0414 (useless-import-alias) in .py files.
Moving it to __init__.pyi keeps the runtime code clean and avoids lint
errors since stub files are not linted.

Co-Authored-By: Claude Sonnet 4 (1M context) <noreply@anthropic.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.

2 participants