Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/google/cloud/iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
... if not my_item.is_valid:
... break
At any point, you may check the number of items consumed by referencing the
``num_results`` property of the iterator::
>>> my_iterator = Iterator(...)
... for my_item in my_iterator:

This comment was marked as spam.

This comment was marked as spam.

... if my_iterator.num_results >= 10:
... break
When iterating, not every new item will send a request to the server.
To iterate based on each page of items (where a page corresponds to
a request)::
Expand Down