diff options
author | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2011-06-15 14:25:33 +0200 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2011-06-15 14:25:33 +0200 |
commit | 8866a89e3cff46dbd791a1385ca5c800a5c9091e (patch) | |
tree | e4e0cd3bf6fdafcc8124a6e77640e7ee3903f02b /bindings/python/docs | |
parent | b7db7ea42056b96578b329db5a184c9c408062c2 (diff) |
python: Remove Messages().__len__
Messages.__len__() exhausted the iterator and list() inherently calls
len(), so we could not invoke list(msgs) without getting errors. Fix
this by implementing __nonzero__ but removing __len__ on Messages.
Use Query.count_messages() or len(list(msgs)) if you need to know the
number.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'bindings/python/docs')
-rw-r--r-- | bindings/python/docs/source/index.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bindings/python/docs/source/index.rst b/bindings/python/docs/source/index.rst index bf0cfd28..d58ba97e 100644 --- a/bindings/python/docs/source/index.rst +++ b/bindings/python/docs/source/index.rst @@ -127,7 +127,12 @@ More information on specific topics can be found on the following pages: .. automethod:: collect_tags - .. automethod:: __len__ + .. method:: __len__() + + .. note:: :meth:`__len__` was removed in version 0.6 as it exhausted + the iterator and broke list(Messages()). Use the + :meth:`Query.count_messages` function or use + `len(list(msgs))`. :class:`Message` -- A single message ---------------------------------------- |