Repository navigation
SourceDocument: a dataclass saved as one module of assignments - #5
Merged
Merged
Conversation
Each constructor field is one module-level assignment named after the field; the field declaration is the only place the name is spelled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 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.
Adds
pycodify.SourceDocument. A dataclass that inherits it is saved as one Python module: each constructor field (init=True) is one module-level assignment named after the field, in declaration order, and is read back by that name.assignment_names(),from_namespace()(a field with a default may be absent; a required one raisesValueError),from_source(),body(),to_source(header=, clean_mode=).init=Falsefields are not saved, matching the dataclass formatter.OpenHCS surface E2 uses it to delete three enums that restated the field names of its pipeline, step and config documents.
No version bump (the owner assigns versions).
Tests:
pytest tests71 passed locally.🤖 Generated with Claude Code