Skip to content

Commit

Permalink
Docstring for Database.count()
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.fysik.dtu.dk/projects/ase/trunk@4679 5af997e4-4c3d-0410-961e-ac0512e437d9
  • Loading branch information
jensj committed Aug 24, 2015
1 parent 858f3fe commit 3784d74
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ase/db/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,11 @@ def select(self, selection=None, filter=None, explain=False,
yield row

def count(self, selection=None, **kwargs):
"""Count rows.
See the select() method for the selection syntax. Use db.count() or
len(db) to count all rows.
"""
n = 0
for row in self.select(selection, **kwargs):
n += 1
Expand Down

0 comments on commit 3784d74

Please sign in to comment.