Skip to content

Commit b3c68fa

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 8ef0759 commit b3c68fa

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
@@ -438,7 +438,7 @@ def __init__(
438438
self,
439439
query: str = "",
440440
id_list: List[str] = [],
441-
max_results: int | None = None,
441+
max_results: int | None = 100,
442442
sort_by: SortCriterion = SortCriterion.Relevance,
443443
sort_order: SortOrder = SortOrder.Descending,
444444
):

0 commit comments

Comments
 (0)