title: How to check whether SQLAlchemy session is dirty or not
body: <p>I have a SQLAlchemy <code>Session</code> object and would like to know whether it is dirty or not. The exact question what I would like to (metaphorically) ask the <code>Session</code> is: "If at this point I issue a <code>commit()</code> or a <code>rollback()</code>, the effect on the database is the same or not?".</p>
  
  <p>The rationale is this: I want to ask the user wether he wants or not to confirm the changes. But if there are no changes, I would like not to ask anything. Of course I may monitor myself all the operations that I perform on the <code>Session</code> and decide whether there were modifications or not, but because of the structure of my program this would require some quite involved changes. If SQLAlchemy already offered this opportunity, I'd be glad to take advantage of it.</p>
  
  <p>Thanks everybody.</p>