You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 8, 2018. It is now read-only.
attrs 17.1.0 changed the default for hash to None, which makes objects unhashable.
In #10, we set hash=False so that we can continue to use objects as keys in dictionaries, but without attempting to hash by value. This matches SQLAlchemy's default behavior.
Having __hash__ not match __cmp__ is weird, which raises the question: should we set cmp=False too? I kind of think we should, but that means attrs_sqlalchemy becomes attr.s(repr=True, hash=False, init=False, cmp=False), so all we're using attrs for is the repr.
I think we'll go ahead with #10, add a deprecation warning to attrs_sqlalchemy.attrs_sqlalchemy, and add a new decorator attrs_sqlalchemy.attrs_sqlalchemy_repr that provides only the repr.
attrs 17.1.0 changed the default for
hashtoNone, which makes objects unhashable.In #10, we set
hash=Falseso that we can continue to use objects as keys in dictionaries, but without attempting to hash by value. This matches SQLAlchemy's default behavior.Having
__hash__not match__cmp__is weird, which raises the question: should we setcmp=Falsetoo? I kind of think we should, but that meansattrs_sqlalchemybecomesattr.s(repr=True, hash=False, init=False, cmp=False), so all we're using attrs for is the repr.I think we'll go ahead with #10, add a deprecation warning to
attrs_sqlalchemy.attrs_sqlalchemy, and add a new decoratorattrs_sqlalchemy.attrs_sqlalchemy_reprthat provides only the repr.Thoughts?
hash=False(BACKWARDS INCOMPATIBLE: Hash instances by object id rather than value #10)attrs_sqlalchemy.attrs_sqlalchemyattrs_sqlalchemy.attrs_sqlalchemy_repr