find_identical_books constructs a search query, which in turn is parsed by a recursive descent parser, hence then recursion depth error on too large a query. You have two options, you can run the search manually, by iterating over book records, or you can break up the list of authors into smaller chunks and combine the results of multiple calls to find_identical_books. The latter will be much slower, but easier to implement.
|