From ad9e30c80a69e08b9d255db7aef569c5619c761a Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Mon, 9 Feb 2015 19:04:44 -0800 Subject: [PATCH] Documenting dunder (e.g. __iter__) methods without docstrings. Fixes #60. --- gcloud/storage/bucket.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/gcloud/storage/bucket.py b/gcloud/storage/bucket.py index 41a946473800..5dc73b58545d 100644 --- a/gcloud/storage/bucket.py +++ b/gcloud/storage/bucket.py @@ -12,7 +12,26 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Create / interact with gcloud storage buckets.""" +"""Create / interact with gcloud storage buckets. + +If you want to check whether a blob exists, you can use the ``in`` operator +in Python:: + + >>> print 'kitten.jpg' in bucket + True + >>> print 'does-not-exist' in bucket + False + +If you want to get all the blobs in the bucket, you can use +:func:`get_all_blobs `:: + + >>> blobs = bucket.get_all_blobs() + +You can also use the bucket as an iterator:: + + >>> for blob in bucket: + ... print blob +""" import os import six