Skip to content

Commit 36fb81b

Browse files
andrewsgparthea
andauthored
docs: Update docstring for lifecycle_rules to match generator behavior (#841)
Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 93b6f97 commit 36fb81b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

google/cloud/storage/bucket.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,12 +2273,12 @@ def lifecycle_rules(self):
22732273
22742274
.. note::
22752275
2276-
The getter for this property returns a list which contains
2276+
The getter for this property returns a generator which yields
22772277
*copies* of the bucket's lifecycle rules mappings. Mutating the
2278-
list or one of its dicts has no effect unless you then re-assign
2279-
the dict via the setter. E.g.:
2278+
output dicts has no effect unless you then re-assign the dict via
2279+
the setter. E.g.:
22802280
2281-
>>> rules = bucket.lifecycle_rules
2281+
>>> rules = list(bucket.lifecycle_rules)
22822282
>>> rules.append({'origin': '/foo', ...})
22832283
>>> rules[1]['rule']['action']['type'] = 'Delete'
22842284
>>> del rules[0]

0 commit comments

Comments
 (0)