We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Cattrs cannot structure My Class if one of my attributes type is a Parent Type of other Child types.
import attrs import cattrs @attrs.define class A: pass @attrs.define class B(A): z: float = attrs.field(validator=attrs.validators.instance_of(float)) @attrs.define class MyClass: test: A = attrs.field(validator=attrs.validators.instance_of(A)) mbis = cattrs.structure({"test": {"z": 3.0}}, MyClass) # mbis = MyClass(test=A()) # should be MyClass(test=B(z=3.0))
The text was updated successfully, but these errors were encountered:
You might want to keep an eye on #312, I think that's what you're after.
Sorry, something went wrong.
No branches or pull requests
Description
Cattrs cannot structure My Class if one of my attributes type is a Parent Type of other Child types.
What I Did
The text was updated successfully, but these errors were encountered: