title: sqlalchemy id equality vs reference equality
body: <p>I'm working with SQLAlchemy for the first time and was wondering...generally speaking is it enough to rely on python's default equality semantics when working with SQLAlchemy vs id (primary key) equality?</p>
  
  <p>In other projects I've worked on in the past using ORM technologies like Java's Hibernate, we'd always override .equals() to check for equality of an object's primary key/id, but when I look back I'm not sure this was always necessary.</p>
  
  <p>In most if not all cases I can think of, you only ever had one reference to a given object with a given id.  And that object was always the attached object so technically you'd be able to get away with reference equality.</p>
  
  <p>Short question: Should I be overriding <strong>eq</strong>() and <strong>hash</strong>() for my business entities when using SQLAlchemy?</p>