Skip to content

the sixty second snippet, run as it is printed - #11

Merged
tamnd merged 1 commit into
mainfrom
sixty-seconds
Aug 18, 2026
Merged

tamnd merged 1 commit into
mainfrom
sixty-seconds

Conversation

@tamnd

@tamnd tamnd commented Aug 18, 2026

Copy link
Copy Markdown
Owner

DX2 (tamnd/zu#168): the 60-second snippet works verbatim, this half in Python. The Rust half is in the engine repository.

A quickstart is the most read and least executed code a client has. It is copied out of a page by hand, and it goes wrong quietly, a rename or a renamed keyword at a time, until somebody's first five minutes are a traceback. tests/test_readme.py runs the README's whole programs as printed, character for character, each in an interpreter of its own with a temporary directory as its working directory, because the file the snippet writes is the one a reader finds beside them afterwards.

A block is a whole program when it starts with import zudb. That is the rule the page already followed, a block that stands on its own carrying its import and a block that shows one call in the middle of a session not carrying one, and the test asserts the page has both kinds so the rule cannot quietly become "run nothing". The load block gained its import, since it stands on its own and was one line short of saying so.

The opening snippet now ends where dx/06 §1 says the sixty seconds end, at .to_pandas(), and the install line above it asks for the extra that last line wants instead of leaving a reader to find out at the end of the snippet. pip install zudb on its own still brings nothing, which the prose now says outright.

Local: ruff check, ruff format --check and the full suite, 387 tests, all green.

A quickstart is the most read and least executed code a client has. It
is copied out of a page by hand, and it goes wrong quietly, a rename at
a time, until somebody's first five minutes are a traceback.

So the whole programs in the README are run here, in an interpreter of
their own with a temporary directory as their working directory, which
is what a reader does with them. A block is a whole program when it
starts with `import zudb`, which is the rule the page already follows:
a block that stands on its own carries its import and a block showing
one call in the middle of a session does not. The load block gained
its import, since it stands on its own and was one line short of it.

The opening snippet now ends where dx/06 §1 says the sixty seconds end,
at `.to_pandas()`, and the install line above it asks for the extra
that last line wants rather than leaving a reader to find out.
@tamnd
tamnd merged commit 16cd812 into main Aug 18, 2026
6 of 8 checks passed
@tamnd
tamnd deleted the sixty-seconds branch August 18, 2026 08:19
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