lukasschwab / arxiv.py

Python wrapper for the arXiv API
MIT License
1.07k stars 120 forks source link

Set default `Search.max_results` to 100 #142

Open lukasschwab opened 11 months ago

lukasschwab commented 11 months ago

Description

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.

Breaking changes

List any changes that break the API usage supported on master.

Changes default Search behavior.

This is arguably a breaking change, but I think it may be appropriate to bundle it into a minor-version release: the existing default behavior is pathological besides on small result sets.

Relevant issues

List GitHub issues relevant to this change.

Checklist