Skip to content

Commit 779b89d

Browse files
committed
Default to 100 max_results
Defaulting to None yields a bad default user experience: if you provide too open-ended a query (e.g. "testing" or "quantum," examples I use in the docs) and try dumping into `list(...)` rather than using a generator, `max_results=None` with the default `page_size` will appear to hang. In practice, one should *only* set `max_results=None` in a loop that processes results incrementally *or* in a long-running process *or* with a query where the result set is known to be small. This is arguably a breaking change, but I think it may be appropriate to bundle it into a minor-version release.
1 parent b73723e commit 779b89d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arxiv/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def __init__(
440440
self,
441441
query: str = "",
442442
id_list: List[str] = [],
443-
max_results: int | None = None,
443+
max_results: int | None = 100,
444444
sort_by: SortCriterion = SortCriterion.Relevance,
445445
sort_order: SortOrder = SortOrder.Descending,
446446
):

0 commit comments

Comments
 (0)