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
I was surprised by the following:
from attr import assoc, attr, attributes from attr.validators import instance_of @attributes class Foo(object): a = attr(validator=instance_of(int)) foo = Foo(1) try: foo = Foo("1") except TypeError: pass else: raise ValueError() try: foo2 = assoc(foo, a="1") except TypeError: pass else: raise ValueError("Could set Foo.a to a string value")
I would expect new instances set through assoc to go through validators. Is this a bug, or is it expected ?
assoc
The text was updated successfully, but these errors were encountered:
Yeah assoc has a design problem so we're replacing it with attr.evolve. Check the CHANGELOG for PRs/issues. Mainly #135
Sorry, something went wrong.
No branches or pull requests
I was surprised by the following:
I would expect new instances set through
assoc
to go through validators. Is this a bug, or is it expected ?The text was updated successfully, but these errors were encountered: