Does anyone know how to get reversed bucket list.
bucketList = self.bucket.list(PREFIX)
bucketList.reverse()
does not work.
Thanks,
Ron.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The reason that you can’t do a reverse of bucket.list() is because that method actually returns a generator rather than the actual list. This is much more efficient and also allows boto to handle all of the paging of results behind the scenes.
If you really want to reverse it you could collect all of the elements in a list and then reverse that:
but if there are a lot of objects in the bucket this will be very inefficient.