Skip to content

Scoped Store len skips an inner scanning len (#223) - #224

Merged
thorwhalen merged 1 commit into
masterfrom
scoped-store-len-walks
Nov 26, 2026
Merged

thorwhalen merged 1 commit into
masterfrom
scoped-store-len-walks

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Closes #223.

Decision on the issue's options: a hybrid. The inner len is still asked first, so a refusing inner store still refuses and an empty sized one costs no scan; but when the inner len is only the default count-by-iterating (Collection.__len__, recursively through Store layers) it can neither refuse nor be cheap, so it is skipped. list(scoped) over Files goes from 3 walks to 2.

Tests: walks counted for plain, stacked and refusing inners; refusal preserved; bool/len agree. Full suite + doctests: 1048 passed. Independent adversarial review: no blocker; its finding (stacked layers) fixed.

@thorwhalen
thorwhalen merged commit 6018328 into master Nov 26, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the scoped-store-len-walks branch November 26, 2026 13:48
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.

list(store) on a scoped Store walks the backend three times

1 participant