Skip to content
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

17.1.0 apparently breaks asdict #192

pauloalem opened this issue May 16, 2017 · 1 comment

17.1.0 apparently breaks asdict #192

pauloalem opened this issue May 16, 2017 · 1 comment


Copy link

@pauloalem pauloalem commented May 16, 2017

Hello there!
I have upgraded to 17.1.0 and aparently it breaks down on asdict convertion.
I've got this utility validator optional_instance_of that ends up raising a

return hash(_attrs_to_tuple(self, attrs))
TypeError: unhashable type: '_OptionalValidator'

Here's a sample to trigger that behavior:

import attr

def optional_instance_of(of):
    return attr.validators.optional(attr.validators.instance_of(of))

class A:
    a = attr.ib(default=None, validator=optional_instance_of(int))

a = A()
print(attr.asdict(a, filter=attr.filters.exclude(type(None))))

Is this related to #142 ?

@pauloalem pauloalem changed the title 17.1.0 breaks conversion 17.1.0 apparently breaks asdict May 16, 2017
Insoleet added a commit to duniter/sakia that referenced this issue May 20, 2017
Copy link

@hynek hynek commented May 22, 2017

should be fixed by #193

@hynek hynek closed this May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants