Skip to content

MultiObj: single_mapping_is_objects opt-out flag (#46) - #103

Merged
thorwhalen merged 1 commit into
masterfrom
feat/multiobj-single-mapping-opt-out-46
Oct 14, 2026
Merged

thorwhalen merged 1 commit into
masterfrom
feat/multiobj-single-mapping-opt-out-46

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Refs #46 (decision on the breaking removal tracked in #102)

Removing MultiObj's "lone mapping = {name: obj}" special case would be a breaking change for a foundation package (MultiObj({...}), FuncFanout({...}), Pipe({...}) rely on it and the docstring documents it). This PR does the backward-compatible part:

  • New class attribute MultiObj.single_mapping_is_objects = True (default = exactly the old behaviour). A subclass sets it to False to hold a lone mapping as an object, e.g. the ContextFanout(store) case from the issue now enters/exits store.
  • Docstring explains the equivalence with MultiObj(**mapping) and the opt-out (doctest).
  • New i2/tests/test_multi_object.py (default behaviour pinned; opt-out with a store that is a context manager).

Whether to flip the default in a future major is the maintainer decision filed as #102 (manual-task), with a recommendation. #46 stays open for that.

Tests / gate: pytest 823 passed, 2 xfailed. priv test-dependents i2 --transitive: 103 suites, 73 pass, 20 fail, per-suite identical to master (pre-existing/environmental). Hosted CI is the gate.

Adversarial review (fresh Opus agent): SAFE. No default-behaviour change for MultiObj/MultiFunc/Pipe/FuncFanout/ParallelFuncs/ContextFanout or fleet subclasses; the class-attribute lookup does not interact with MultiObj.__getattr__; pickle/copy unchanged. Only theoretical edge: an object named single_mapping_is_objects is shadowed on attribute access (no fleet use).

🤖 Generated with Claude Code

…f the lone-mapping special case (#46)

Default unchanged (backward compatible).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit e1d7d93 into master Oct 14, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the feat/multiobj-single-mapping-opt-out-46 branch October 14, 2026 00:31
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