Skip to content

docs: align docs and type hints with runtime behavior - #644

Merged
msiemens merged 1 commit into
msiemens:masterfrom
uadhran:docs/630-docs-type-mismatches
Oct 5, 2026
Merged

msiemens merged 1 commit into
msiemens:masterfrom
uadhran:docs/630-docs-type-mismatches

Conversation

@uadhran

@uadhran uadhran commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Aligns documentation and type annotations with actual runtime behavior, as listed in #630. No intentional behavior changes.

Item Change
Query.test Callable[..., bool]; docstring says field value
operations.add n: Union[int, float, str]
usage.rst Fix broken update_multiple braces; get is first match, not random
Package docstring Remove invented _id field
Table.get docstring doc_ids → list (possibly empty); single get → doc or None
Query.search Flags documented as re.search

Fixes #630

Test plan

  • uv run py.test tests/test_queries.py tests/test_operations.py tests/test_tinydb.py -q --mypy (165 passed)

Fix mismatches called out in msiemens#630:
- Query.test: Callable[..., bool] and field-value docs
- operations.add: allow str in the type hint
- usage.rst: fix update_multiple example; clarify get() order
- package docstring: drop invented _id field
- Table.get docstring: document doc_ids list / None correctly
- Query.search: flags go to re.search

Fixes msiemens#630
@msiemens

msiemens commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Thanks!

@msiemens
msiemens merged commit efe9da1 into msiemens:master Oct 5, 2026
31 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.

Docs and type hints disagree with runtime for several public APIs

2 participants