Skip to content

Commit

Permalink
docs: Update docstring for lifecycle_rules to match generator behavior (
Browse files Browse the repository at this point in the history
#841)

Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
andrewsg and parthea committed Aug 12, 2022
1 parent 93b6f97 commit 36fb81b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions google/cloud/storage/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -2273,12 +2273,12 @@ def lifecycle_rules(self):
.. note::
The getter for this property returns a list which contains
The getter for this property returns a generator which yields
*copies* of the bucket's lifecycle rules mappings. Mutating the
list or one of its dicts has no effect unless you then re-assign
the dict via the setter. E.g.:
output dicts has no effect unless you then re-assign the dict via
the setter. E.g.:
>>> rules = bucket.lifecycle_rules
>>> rules = list(bucket.lifecycle_rules)
>>> rules.append({'origin': '/foo', ...})
>>> rules[1]['rule']['action']['type'] = 'Delete'
>>> del rules[0]
Expand Down

0 comments on commit 36fb81b

Please sign in to comment.