Skip to content

Preserve configuration when copying ConfigBox - #325

Open
oyeong011 wants to merge 2 commits into
cdgriffith:developfrom
oyeong011:fix/configbox-bool
Open

Preserve configuration when copying ConfigBox#325
oyeong011 wants to merge 2 commits into
cdgriffith:developfrom
oyeong011:fix/configbox-bool

Conversation

@oyeong011

Copy link
Copy Markdown

Copying a ConfigBox currently discards options such as frozen_box and default_box, so a frozen copy becomes writable and default-value lookups stop working.

Preserve the ConfigBox configuration while excluding internal bookkeeping and detaching its namespace. Generic Box.copy keeps its existing behavior, including for subclasses with required constructor arguments; ConfigBox subclasses still copy to ConfigBox.

Validation: 169 tests passed on Python 3.14, including copy/copy.copy frozen/default regressions, constructor compatibility, namespace detachment and internal-key exclusion. Public API QA also passes. Cython and the remaining interpreter matrix were not run.

AI assistance: OpenAI Codex prepared the change and regression tests.

Tested: 163 tests passed; copy and copy.copy public API QA

Confidence: high

Scope-risk: moderate

Directive: Copies retain the concrete Box subclass and detach their namespace.
Constraint: Generic Box subclasses retain the existing Box return type, including subclasses with required constructor arguments.

Rejected: Constructing type(self) in Box.copy | breaks incompatible subclass constructors

Tested: 169 tests passed; public copy and copy.copy subclass/namespace QA

Confidence: high

Scope-risk: narrow
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