-
Notifications
You must be signed in to change notification settings - Fork 2
Add a Dataclass protocol type #38
Copy link
Copy link
Open
Labels
part:typingAffects the typing moduleAffects the typing moduletype:enhancementNew feature or enhancement visitble to usersNew feature or enhancement visitble to users
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
part:typingAffects the typing moduleAffects the typing moduletype:enhancementNew feature or enhancement visitble to usersNew feature or enhancement visitble to users
Type
Fields
Priority
None yet
What's needed?
It is sometimes useful when working with dataclasses in a generic way to be able to have a type-hint that will detect passing non-dataclasses by
mypyinstead of at runtime.Proposed solution
Add a new class to
frequenz.core.typinglike:Use cases
Wrappers using
marshmallow_dataclass, where we want to make sure we take a dataclass, for example for loading as if it where a schema.Alternatives and workarounds
No response
Additional context
No response