Describe the bug
Calling limit(0) on a ResourceCollection yields one item instead of none.
Regression Issue
Expected Behavior
Current Behavior
Reproduction Steps
from boto3.resources.collection import ResourceCollection
class DummyCollection(ResourceCollection):
def __init__(self, limit):
self._params = {"limit": limit}
def pages(self):
yield ["first", "second"]
items = list(DummyCollection(0))
print(items)
Possible Solution
No response
Additional Information/Context
Note: This issue was identified by an automated testing tool for academic research and manually checked. If you have any concerns about this type of reporting, please let me know, and I will adjust my workflow accordingly. Thanks.
SDK version used
1.40.64
Environment details (OS name and version, etc.)
Linux | Python3.12
Describe the bug
Calling
limit(0)on aResourceCollectionyields one item instead of none.Regression Issue
Expected Behavior
Current Behavior
Reproduction Steps
Possible Solution
No response
Additional Information/Context
SDK version used
1.40.64
Environment details (OS name and version, etc.)
Linux | Python3.12