Skip to content

Commit 2bba445

Browse files
committed
replace Optional[T] with T | None everywhere
1 parent e2bcb66 commit 2bba445

File tree

10 files changed

+58
-58
lines changed

10 files changed

+58
-58
lines changed

github/content/announcement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def expires_at(
9090
"""
9191
The date and time at which the announcement will expire.
9292
93-
:type: Optional[:class:`~datetime.datetime`]
93+
:type: :class:`~datetime.datetime` | None
9494
"""
9595

9696
expires_at = self._data["expiresAt"]

github/content/codeofconduct.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def resource_path(
123123
"""
124124
An HTTP path to the resource.
125125
126-
:type: Optional[:class:`str`]
126+
:type: :class:`str` | None
127127
"""
128128

129129
return super().resource_path
@@ -136,7 +136,7 @@ def url(
136136
"""
137137
An HTTP URL to the resource.
138138
139-
:type: Optional[:class:`str`]
139+
:type: :class:`str` | None
140140
"""
141141

142142
return super().url
@@ -311,7 +311,7 @@ async def fetch_resource_path(
311311
:attr:`url` attributes are missing.
312312
313313
314-
:rtype: Optional[:class:`str`]
314+
:rtype: :class:`str` | None
315315
"""
316316

317317
return await super().fetch_resource_path() # type: ignore
@@ -337,7 +337,7 @@ async def fetch_url(
337337
:attr:`url` attributes are missing.
338338
339339
340-
:rtype: Optional[:class:`str`]
340+
:rtype: :class:`str` | None
341341
"""
342342

343343
return await super().fetch_url() # type: ignore

github/content/license.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def choosealicense_url(
120120
"""
121121
A URL to the license on |choosealicense|.
122122
123-
:type: Optional[:class:`str`]
123+
:type: :class:`str` | None
124124
"""
125125

126126
return self._data["url"]
@@ -146,7 +146,7 @@ def description(
146146
"""
147147
A description of the license.
148148
149-
:type: Optional[:class:`str`]
149+
:type: :class:`str` | None
150150
"""
151151

152152
return self._data["description"]
@@ -159,7 +159,7 @@ def implementation(
159159
"""
160160
A guide to implementing the license.
161161
162-
:type: Optional[:class:`str`]
162+
:type: :class:`str` | None
163163
"""
164164

165165
return self._data["implementation"]
@@ -250,7 +250,7 @@ def nickname(
250250
"""
251251
The human-readable nickname of the license.
252252
253-
:type: Optional[:class:`str`]
253+
:type: :class:`str` | None
254254
"""
255255

256256
return self._data["nickname"]
@@ -276,7 +276,7 @@ def spdx_id(
276276
"""
277277
The ID of the license on |spdx|.
278278
279-
:type: Optional[:class:`str`]
279+
:type: :class:`str` | None
280280
"""
281281

282282
return self._data["spdxId"]
@@ -364,7 +364,7 @@ async def fetch_choosealicense_url(
364364
The :attr:`id` attribute is missing.
365365
366366
367-
:rtype: Optional[:class:`str`]
367+
:rtype: :class:`str` | None
368368
"""
369369

370370
return await self._fetch_field("url") # type: ignore
@@ -414,7 +414,7 @@ async def fetch_description(
414414
The :attr:`id` attribute is missing.
415415
416416
417-
:rtype: Optional[:class:`str`]
417+
:rtype: :class:`str` | None
418418
"""
419419

420420
return await self._fetch_field("description") # type: ignore
@@ -464,7 +464,7 @@ async def fetch_implementation(
464464
The :attr:`id` attribute is missing.
465465
466466
467-
:rtype: Optional[:class:`str`]
467+
:rtype: :class:`str` | None
468468
"""
469469

470470
return await self._fetch_field("implementation") # type: ignore
@@ -639,7 +639,7 @@ async def fetch_nickname(
639639
The :attr:`id` attribute is missing.
640640
641641
642-
:rtype: Optional[:class:`str`]
642+
:rtype: :class:`str` | None
643643
"""
644644

645645
return await self._fetch_field("nickname") # type: ignore
@@ -689,7 +689,7 @@ async def fetch_spdx_id(
689689
The :attr:`id` attribute is missing.
690690
691691
692-
:rtype: Optional[:class:`str`]
692+
:rtype: :class:`str` | None
693693
"""
694694

695695
return await self._fetch_field("spdxId") # type: ignore

github/core/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,11 @@ async def update_status(
635635
636636
Parameters
637637
----------
638-
message: Optional[:class:`str`]
638+
message: :class:`str` | None
639639
The message to display on the status.
640640
busy: :class:`bool`
641641
Whether to mark the user as busy.
642-
emoji: Optional[:class:`str`]
642+
emoji: :class:`str` | None
643643
The emoji to display on the status. This can either be a
644644
unicode emoji or its name with colons.
645645
expires_at: :class:`~datetime.datetime`
@@ -649,7 +649,7 @@ async def update_status(
649649
status.
650650
651651
652-
:rtype: Optional[:class:`~github.UserStatus`]
652+
:rtype: :class:`~github.UserStatus` | None
653653
"""
654654

655655
data = await self._http.mutate_user_update_status(

github/core/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class ClientResponseHTTPUnauthorizedError(ClientResponseHTTPError):
249249
response: :class:`aiohttp.ClientResponse`
250250
The client response.
251251
252-
data: Optional[:class:`dict`]
252+
data: :class:`dict` | None
253253
The response data.
254254
"""
255255

github/interfaces/comment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def edited_at(
169169
"""
170170
The date and time at which the comment was last edited.
171171
172-
:type: Optional[:class:`~datetime.datetime`]
172+
:type: :class:`~datetime.datetime` | None
173173
"""
174174

175175
edited_at = self._data["lastEditedAt"]
@@ -200,7 +200,7 @@ def published_at(
200200
"""
201201
The date and time at which the comment was published.
202202
203-
:type: Optional[:class:`~datetime.datetime`]
203+
:type: :class:`~datetime.datetime` | None
204204
"""
205205

206206
published_at = self._data["publishedAt"]

github/interfaces/profileowner.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def email(
9393
- ``read:org`` for :attr:`Organization.email`.
9494
- ``read:user`` OR ``user:email`` for :attr:`User.email`.
9595
96-
:type: Optional[:class:`str`]
96+
:type: :class:`str` | None
9797
"""
9898

9999
return self._data["email"]
@@ -132,7 +132,7 @@ def location(
132132
"""
133133
The location of the profile owner.
134134
135-
:type: Optional[:class:`str`]
135+
:type: :class:`str` | None
136136
"""
137137

138138
return self._data["location"]
@@ -145,7 +145,7 @@ def name(
145145
"""
146146
The name of the profile owner.
147147
148-
:type: Optional[:class:`str`]
148+
:type: :class:`str` | None
149149
"""
150150

151151
return self._data["name"]
@@ -171,7 +171,7 @@ def website(
171171
"""
172172
The website of the profile owner.
173173
174-
:type: Optional[:class:`str`]
174+
:type: :class:`str` | None
175175
"""
176176

177177
return self._data["websiteUrl"]
@@ -202,7 +202,7 @@ async def fetch_email(
202202
The token used by the client does not have the required scopes.
203203
204204
205-
:rtype: Optional[:class:`str`]
205+
:rtype: :class:`str` | None
206206
"""
207207

208208
return await self._fetch_field("email") # type: ignore

github/organization/organization.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def archived_at(
176176
"""
177177
The date and time at which the organization was archived.
178178
179-
:type: Optional[:class:`~datetime.datetime`]
179+
:type: :class:`~datetime.datetime` | None
180180
"""
181181

182182
archived_at = self._data["archivedAt"]
@@ -247,7 +247,7 @@ def description(
247247
"""
248248
The description of the organization.
249249
250-
:type: Optional[:class:`str`]
250+
:type: :class:`str` | None
251251
"""
252252

253253
return self._data["description"]
@@ -267,7 +267,7 @@ def description_html(
267267
- Sanitizes the string such that it cannot contain HTML tags.
268268
- Wraps the string in ``<div>`` tags.
269269
270-
:type: Optional[:class:`str`]
270+
:type: :class:`str` | None
271271
"""
272272

273273
return self._data["descriptionHTML"]
@@ -345,7 +345,7 @@ def twitter_username(
345345
"""
346346
The Twitter username of the organization.
347347
348-
:type: Optional[:class:`str`]
348+
:type: :class:`str` | None
349349
"""
350350

351351
return self._data["twitterUsername"]
@@ -381,7 +381,7 @@ async def fetch_archived_at(
381381
The :attr:`id` attribute is missing.
382382
383383
384-
:rtype: Optional[:class:`~datetime.datetime`]
384+
:rtype: :class:`~datetime.datetime` | None
385385
"""
386386

387387
archived_at = await self._fetch_field("archivedAt")
@@ -507,7 +507,7 @@ async def fetch_description(
507507
The :attr:`id` attribute is missing.
508508
509509
510-
:rtype: Optional[:class:`str`]
510+
:rtype: :class:`str` | None
511511
"""
512512

513513
return await self._fetch_field("description") # type: ignore
@@ -529,7 +529,7 @@ async def fetch_description_html(
529529
The :attr:`id` attribute is missing.
530530
531531
532-
:rtype: Optional[:class:`str`]
532+
:rtype: :class:`str` | None
533533
"""
534534

535535
return await self._fetch_field("descriptionHTML") # type: ignore
@@ -664,7 +664,7 @@ async def fetch_twitter_username(
664664
The :attr:`id` attribute is missing.
665665
666666
667-
:rtype: Optional[:class:`str`]
667+
:rtype: :class:`str` | None
668668
"""
669669

670670
return await self._fetch_field("twitterUsername") # type: ignore

0 commit comments

Comments
 (0)