GeezerVison is showing github.com — CORS documentation missing setter · Issue #1838 · googleapis/google-cloud-python
CORS documentation missing setter #1838Activitypdknsk commented on May 31, 2016 (I think this also applies to a few other properties.) daspecster commented on Jun 1, 2016 tseaver commented on Jun 2, 2016 @daspecster Docstrings for @property objects are derived from their getters:
>>> class Foo(object):
... @property
... def bar(self):
... """bar getter"""
... @bar.setter
... def bar(self, value):
... """bar setter"""
... @bar.deleter
... def bar(self):
... """bar deleter"""
...
>>> Foo.bar
<property object at 0x7f8fe9a856d8>
>>> Foo.bar.__doc__
'bar getter' daspecster commented on Jun 2, 2016 Cool, what if we just combine the docs in some way that makes sense in the getter?
@property
def cors(self):
"""Get/Set CORS policies configured for this bucket.
See: http://www.w3.org/TR/cors/ and
https://cloud.google.com/storage/docs/json_api/v1/buckets
:setter: Set CORS policies for this bucket.
:getter: Gets the CORS policies for this bucket.
"""
return [copy.deepcopy(policy)
for policy in self._properties.get('cors', ())]
@cors.setter
def cors(self, entries):
"""Set CORS policies configured for this bucket.
See: http://www.w3.org/TR/cors/ and
https://cloud.google.com/storage/docs/json_api/v1/buckets
:type entries: list of dictionaries
:param entries: A sequence of mappings describing each CORS policy.
"""
self._patch_property('cors', entries)mlissner commented on Oct 26, 2016 I filed #2610 where the same issue applies to the setter for lifecycle_rules. Seems like a very simple solution here is what @daspecster proposed. It's not perfect, but if it had been done back in June when it was proposed, I would have been a happier customer. added a commit that references this issue on Oct 26, 2016This issue will close once commit 476ab7d is merged into the 'master' branch.476ab7d daspecster commented on Oct 26, 2016 @mlissner, sorry you lost cycles on this.
I made #2623 to hopefully resolve this for future users.
Thanks for reporting as well. added a commit that references this issue on May 6, 2017This issue will close once commit a935c19 is merged into the 'master' branch.a935c19 added 2 commits that reference this issue on Mar 6, 2026This issue will close once commit 769b64b is merged into the 'main' branch.769b64b This issue will close once commit 482be80 is merged into the 'main' branch.482be80
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|