Skip to content

Commit 775ebef

Browse files
committed
Add a docstring to PagingService
1 parent 901323e commit 775ebef

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sunlight/pagination.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ def pageable(func):
1010

1111

1212
class PagingService(object):
13+
"""
14+
PagingService wraps normal services and iterates over the results of consecutive API calls. ::
15+
16+
from sunlight import congress
17+
from sunlight.pagination import PagingService
18+
19+
congress = PagingService(congress)
20+
21+
print(len(list(congress.legislators(limit=55)))) # page more than a single page
22+
23+
"""
1324

1425
limit_attr = 'limit'
1526
page_attr = 'page'

0 commit comments

Comments
 (0)