Skip to content

Commit

Permalink
api-usage: bit more detail for listing with all
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauvain Pocentek committed May 11, 2018
1 parent 68b798b commit 4cc9739
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions docs/api-usage.rst
Expand Up @@ -228,15 +228,16 @@ parameter to get all the items when using listing methods:
.. warning::

python-gitlab will iterate over the list by calling the corresponding API
multiple times. This might take some time if you have a lot of items to
retrieve. This might also consume a lot of memory as all the items will be
stored in RAM. If you're encountering the python recursion limit exception,
use ``safe_all=True`` instead to stop pagination automatically if the
recursion limit is hit.

With v4, ``list()`` methods can also return a generator object which will
handle the next calls to the API when required:
With API v3 python-gitlab will iterate over the list by calling the
corresponding API multiple times. This might take some time if you have a
lot of items to retrieve. This might also consume a lot of memory as all the
items will be stored in RAM. If you're encountering the python recursion
limit exception, use ``safe_all=True`` to stop pagination automatically if
the recursion limit is hit.

With API v4, ``list()`` methods can also return a generator object which will
handle the next calls to the API when required. This is the recommended way to
iterate through a large number of items:

.. code-block:: python
Expand Down

0 comments on commit 4cc9739

Please sign in to comment.