title: Count of deleted entities on app engine using db.delete(iterator_of_keys)
body: <p>I find the entities I want to delete:</p>
  
  <p><code>to_delete_iterator = models.Foo.all().filter('bar =', baz).run(keys_only = True, batch_size = 1000)</code></p>
  
  <p>Then I delete them </p>
  
  <p><code>db.delete(to_delete_iterator)</code></p>
  
  <p>Which seems to work fine. But I'd like to log the number of entities that I deleted. Is there a way to get that result from <code>db</code>? If not, I think my only option is to loop over <code>to_delete_iterator</code>, build a list, takes it's length, and then pass that to <code>db.delete</code>. Any better options that this?</p>
  
  <pre><code>to_delete_keys = []
  for key in to_delete_iterator:
    to_delete_keys.append(key)
  
  logging.debug('&gt;&gt; will delete ' + str(len(to_delete_keys)) + ' old entities')   
  db.delete(to_delete_keys)  
  </code></pre>
  
  <p>Presumably it uses a little more memory than passing the iterator to db.delete, but for keys_only that may not be an issue</p>