Created
January 18, 2013 13:26
-
-
Save tinnet/4564533 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def wrap_list_in_result_dict(entities, page=1, total_pages=1, num_results=None): | |
return dict( | |
entities=entities, | |
page=page, | |
total_pages=total_pages, | |
num_results=num_results or len(entities)) | |
# this is the entire list | |
print wrap_list_in_result_dict([1,2,3,4]) | |
# this is a part, but i know how many there are | |
print wrap_list_in_result_dict([1,2,3,4], 1, 1, 1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment