Skip to content

fix: store_from_source builds dol-wrapped classes (#10) - #13

Merged
thorwhalen merged 2 commits into
masterfrom
fix/store-from-source-wrapped-10
Oct 13, 2026
Merged

thorwhalen merged 2 commits into
masterfrom
fix/store-from-source-wrapped-10

Conversation

@thorwhalen

@thorwhalen thorwhalen commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Fixes #10. store_from_source(r, RedisStoreWithNumericLists) raised AttributeError: 'store': it used object.__new__ and set _source, but a dol-wrapped class delegates to an inner instance (.store). Now, for a dol.Store subclass, the wrapped class and the wrapper class are recovered from the closure of dol's generated __init__ (recursively for stacked wrappers); the inner is built over source and the wrapper's own __init__ runs on it, as in the normal constructor. If it can't be determined (not a dol class-wrapper, a subclass overriding __init__, cache_vals...), a clear TypeError. A public attribute from dol would be cleaner: i2mint/dol#131.

Adversarial review (Opus): confirmed the wrapper's own __init__ was skipped (a Store subclass with state, wrap_kvs(wrapper=...)): fixed, with tests. Verified equal to the normal constructor for wrap_kvs, KeyCodecs+filt_iter, cached_keys, Pipe, mk_read_only, add_path_get; unsupported shapes are refused rather than half-built.

🤖 Generated with Claude Code

thorwhalen and others added 2 commits October 13, 2026 14:10
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
#13)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit 98e8e03 into master Oct 13, 2026
8 checks passed
@thorwhalen
thorwhalen deleted the fix/store-from-source-wrapped-10 branch October 13, 2026 14:15
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.

store_from_source(r, RedisStoreWithNumericLists) raises AttributeError ('store')

1 participant