Skip to content
This repository was archived by the owner on Mar 8, 2018. It is now read-only.
This repository was archived by the owner on Mar 8, 2018. It is now read-only.

attrs 17.1.0+ compatibility #11

@rouge8

Description

@rouge8

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.

Thoughts?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions