Skip to content

Commit 63e668c

Browse files
authored
Merge pull request #2584 from tswast/nonetype-to-optional
Remove None & NoneType from parameter types in docstrings.
2 parents e6625a9 + 6ad44a5 commit 63e668c

File tree

4 files changed

+31
-30
lines changed

4 files changed

+31
-30
lines changed

packages/google-cloud-storage/google/cloud/storage/acl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,10 @@ def _save(self, acl, predefined, client):
419419
:param acl: The ACL object to save. If left blank, this will save
420420
current entries.
421421
422-
:type predefined: str or None
423-
:param predefined: An identifier for a predefined ACL. Must be one
424-
of the keys in :attr:`PREDEFINED_JSON_ACLS`
425-
If passed, `acl` must be None.
422+
:type predefined: str
423+
:param predefined:
424+
(Optional) An identifier for a predefined ACL. Must be one of the
425+
keys in :attr:`PREDEFINED_JSON_ACLS` If passed, `acl` must be None.
426426
427427
:type client: :class:`~google.cloud.storage.client.Client` or
428428
``NoneType``

packages/google-cloud-storage/google/cloud/storage/batch.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class MIMEApplicationHTTP(MIMEApplication):
4444
:type headers: dict
4545
:param headers: HTTP headers
4646
47-
:type body: str or None
48-
:param body: HTTP payload
47+
:type body: str
48+
:param body: (Optional) HTTP payload
4949
5050
"""
5151
def __init__(self, method, uri, headers, body):
@@ -154,11 +154,11 @@ def _do_request(self, method, url, headers, data, target_object):
154154
:type data: str
155155
:param data: The data to send as the body of the request.
156156
157-
:type target_object: object or :class:`NoneType`
158-
:param target_object: This allows us to enable custom behavior in our
159-
batch connection. Here we defer an HTTP request
160-
and complete initialization of the object at a
161-
later time.
157+
:type target_object: object
158+
:param target_object:
159+
(Optional) This allows us to enable custom behavior in our batch
160+
connection. Here we defer an HTTP request and complete
161+
initialization of the object at a later time.
162162
163163
:rtype: tuple of ``response`` (a dictionary of sorts)
164164
and ``content`` (a string).

packages/google-cloud-storage/google/cloud/storage/blob.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def chunk_size(self):
9494
def chunk_size(self, value):
9595
"""Set the blob's default chunk size.
9696
97-
:type value: int or ``NoneType``
98-
:param value: The current blob's chunk size, if it is set.
97+
:type value: int
98+
:param value: (Optional) The current blob's chunk size, if it is set.
9999
100100
:raises: :class:`ValueError` if ``value`` is not ``None`` and is not a
101101
multiple of 256 KB.
@@ -450,7 +450,7 @@ def upload_from_file(self, file_obj, rewind=False, size=None,
450450
:func:`os.fstat`. (If the file handle is not from the
451451
filesystem this won't be possible.)
452452
453-
:type content_type: str or ``NoneType``
453+
:type content_type: str
454454
:param content_type: Optional type of content being uploaded.
455455
456456
:type num_retries: int
@@ -567,7 +567,7 @@ def upload_from_filename(self, filename, content_type=None, client=None):
567567
:type filename: str
568568
:param filename: The path to the file.
569569
570-
:type content_type: str or ``NoneType``
570+
:type content_type: str
571571
:param content_type: Optional type of content being uploaded.
572572
573573
:type client: :class:`~google.cloud.storage.client.Client` or
@@ -861,8 +861,8 @@ def metadata(self, value):
861861
862862
See: https://cloud.google.com/storage/docs/json_api/v1/objects
863863
864-
:type value: dict or ``NoneType``
865-
:param value: The blob metadata to set.
864+
:type value: dict
865+
:param value: (Optional) The blob metadata to set.
866866
"""
867867
self._patch_property('metadata', value)
868868

packages/google-cloud-storage/google/cloud/storage/client.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -227,28 +227,29 @@ def list_buckets(self, max_results=None, page_token=None, prefix=None,
227227
228228
This implements "storage.buckets.list".
229229
230-
:type max_results: int or ``NoneType``
230+
:type max_results: int
231231
:param max_results: Optional. Maximum number of buckets to return.
232232
233-
:type page_token: str or ``NoneType``
233+
:type page_token: str
234234
:param page_token: Optional. Opaque marker for the next "page" of
235235
buckets. If not passed, will return the first page
236236
of buckets.
237237
238-
:type prefix: str or ``NoneType``
238+
:type prefix: str
239239
:param prefix: Optional. Filter results to buckets whose names begin
240240
with this prefix.
241241
242-
:type projection: str or ``NoneType``
243-
:param projection: If used, must be 'full' or 'noAcl'. Defaults to
244-
'noAcl'. Specifies the set of properties to return.
245-
246-
:type fields: str or ``NoneType``
247-
:param fields: Selector specifying which fields to include in a
248-
partial response. Must be a list of fields. For example
249-
to get a partial response with just the next page token
250-
and the language of each bucket returned:
251-
'items/id,nextPageToken'
242+
:type projection: str
243+
:param projection:
244+
(Optional) Specifies the set of properties to return. If used, must
245+
be 'full' or 'noAcl'. Defaults to 'noAcl'.
246+
247+
:type fields: str
248+
:param fields:
249+
(Optional) Selector specifying which fields to include in a partial
250+
response. Must be a list of fields. For example to get a partial
251+
response with just the next page token and the language of each
252+
bucket returned: 'items/id,nextPageToken'
252253
253254
:rtype: :class:`~google.cloud.iterator.Iterator`
254255
:returns: Iterator of all :class:`~google.cloud.storage.bucket.Bucket`

0 commit comments

Comments
 (0)