Repository navigation
MultiObj: single_mapping_is_objects opt-out flag (#46) - #103
Merged
Merged
Conversation
…f the lone-mapping special case (#46) Default unchanged (backward compatible). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:MultiObj.single_mapping_is_objects = True(default = exactly the old behaviour). A subclass sets it toFalseto hold a lone mapping as an object, e.g. theContextFanout(store)case from the issue now enters/exitsstore.MultiObj(**mapping)and the opt-out (doctest).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:
pytest823 passed, 2 xfailed.priv test-dependents i2 --transitive: 103 suites, 73 pass, 20 fail, per-suite identical tomaster(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 namedsingle_mapping_is_objectsis shadowed on attribute access (no fleet use).🤖 Generated with Claude Code