Correct behavior of ItemQuery?

Yasushi Iwata <[email protected]> Fri, 6 Feb 2009 20:00:31 +0900
Newsgroups gmane.comp.python.quotient.dev
Message-ID <[email protected]>
Hi,

Here's my script:

  from axiom.item import Item
  from axiom.store import Store
  from axiom.attributes import text

  class Foo(Item):
      value = text()

  st = Store()
  for i in xrange(100):
      Foo(store=st, value=u"spam")

  result = st.query(Foo, Foo.value==u"spam", limit=10)
  print "result.count() ->", result.count()
  print "len(list(result)) ->", len(list(result))

and I got result like this:

  $ python foo.py
  result.count() -> 100
  len(list(result)) -> 10

Why result.count() does not return 10? Is this correct behavior?