scholarly-python-package / scholarly

Retrieve author and publication information from Google Scholar in a friendly, Pythonic way without having to worry about CAPTCHAs!
https://scholarly.readthedocs.io/
The Unlicense
1.29k stars 292 forks source link

publication `fill` both updates **in place** and returns the same publication #532

Open neuromechanist opened 5 months ago

neuromechanist commented 5 months ago

Describe the bug Here is the definition of the fill method:

def fill(self, publication: Publication)->Publication:
.
.
.
    return publication

To Reproduce

import scholarly
query = scholarly.search_pubs('general relativity')
query = next(query)

filled_query = scholarly.fill(query)

# check if filled_query and query are the same
filled_query is query

Expected behavior Updating the publication in place is redundant when there is a returned publication. I suggest copying the the publication and updating the copy, so the original publication remains intact. The other option is to make the changes in place and remove the return statement.

Do you plan on contributing? Your response below will clarify whether the maintainers can expect you to fix the bug you reported.