Skip to content

The value of "more" in tuple returned by fetch_page() should always be a bool. #422

@muzzi92

Description

@muzzi92

more = results and (
iterator._more_results_after_limit or iterator.probably_has_next()
)

For consistency, the type of more should always be boolean (as suggested by the function's doc-string). However due to the current evaluation, it can sometimes be a list.

In the case where there are no results found, results will be an empty list and hence so will more.

i.e.

[] and False = [] # Not "False"

I noticed this, as I am serialising these values into a Protobuf which is type checking.

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions