💥 boom: replace DataclassInstance with optype.HasDataclassFields#78
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the project’s custom DataclassInstance protocol and switches dataclass-related dispatch/type annotations to use optype.dataclasses.HasDataclassFields instead.
Changes:
- Removed
DataclassInstancefromdataclassish._src.typesand from the top-leveldataclassishexports. - Updated dataclass dispatch registrations (
get_field,replace,fields,asdict,astuple) to acceptopt.dataclasses.HasDataclassFields. - Adjusted a converters module docstring to no longer mention
DataclassInstance.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/dataclassish/_src/types.py | Deletes the DataclassInstance protocol and updates __all__ accordingly. |
| src/dataclassish/_src/register_dataclass.py | Replaces DataclassInstance annotations with opt.dataclasses.HasDataclassFields for dispatch signatures. |
| src/dataclassish/_src/converters.py | Docstring wording update referencing “Dataclass instance” instead of DataclassInstance. |
| src/dataclassish/init.py | Removes DataclassInstance from the public package exports/imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…elds Signed-off-by: nstarman <nstarman@users.noreply.github.com>
nstarman
force-pushed
the
optype-followup
branch
from
February 22, 2026 20:19
70fe33f to
d9a853d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
==========================================
- Coverage 97.32% 97.26% -0.06%
==========================================
Files 12 12
Lines 299 293 -6
==========================================
- Hits 291 285 -6
Misses 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Further simplification.