-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IsDataclass
type
#67
Comments
Yes please, module up to you.
If you want Another question, should |
I had in mind an argument for it, but I guess having a different class itself is much more explicit.
Wouldn't this just come down to the following check(s)? from dirty_equals import IsDict, IsPartialDict
instance.__dict__ == IsDict(foo=4, bar=5)
# or
instance.__dict__ == IsPartialDict(foo=4) |
Or |
What do you think about the following case: @dataclass
class Foo:
a: int
b: int
foo = Foo(a=1, b=2)
foo == IsDataclass # -> True
foo == IsDataclass(a=1, b=2) # -> True
foo == IsDataclass(a=1) # -> False
foo == IsDataclass() # -> ??? (Current implementation I have makes it |
Addresses #67 by introducing the following types: - `IsDataclassType`: checks if type is dataclass. - `IsDataclass`: checks if instance is dataclass, and possibly checks exact matching of attribute values using `IsDict`. - `IsPartialDataclass`: checks if instance is dataclass, and possibly checks partial matching of attribute values using `IsPartialDict`.
I would be happy to work on
IsDataclass
(related to #3).Before starting I have a few questions:
_other
module?dataclasses.is_dataclass
?The text was updated successfully, but these errors were encountered: