Skip to content

Commit 15ece68

Browse files
committed
Opt in to PEP 649.
1 parent f6800c7 commit 15ece68

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

src/akismet/_async_client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
# SPDX-License-Identifier: BSD-3-Clause
77

8+
from __future__ import annotations
9+
810
from types import TracebackType
911
from typing import TYPE_CHECKING, Literal, Optional, Type, Union
1012

@@ -124,14 +126,14 @@ class AsyncClient:
124126
"""
125127

126128
_http_client: httpx.AsyncClient
127-
_config: "akismet.Config"
129+
_config: akismet.Config
128130

129131
# Constructors.
130132
# ----------------------------------------------------------------------------
131133

132134
def __init__(
133135
self,
134-
config: Optional["akismet.Config"] = None,
136+
config: Optional[akismet.Config] = None,
135137
http_client: Optional[httpx.AsyncClient] = None,
136138
) -> None:
137139
"""
@@ -146,7 +148,7 @@ def __init__(
146148
@classmethod
147149
async def validated_client(
148150
cls,
149-
config: Optional["akismet.Config"] = None,
151+
config: Optional[akismet.Config] = None,
150152
http_client: Optional[httpx.AsyncClient] = None,
151153
) -> Self:
152154
"""
@@ -339,7 +341,7 @@ async def _submit(
339341

340342
async def comment_check(
341343
self, user_ip: str, **kwargs: Unpack[_common.AkismetArguments]
342-
) -> "akismet.CheckResponse":
344+
) -> akismet.CheckResponse:
343345
"""
344346
Check a piece of user-submitted content to determine whether it is spam.
345347

src/akismet/_sync_client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
# SPDX-License-Identifier: BSD-3-Clause
77

8+
from __future__ import annotations
9+
810
from types import TracebackType
911
from typing import TYPE_CHECKING, Literal, Optional, Type, Union
1012

@@ -124,14 +126,14 @@ class SyncClient:
124126
"""
125127

126128
_http_client: httpx.Client
127-
_config: "akismet.Config"
129+
_config: akismet.Config
128130

129131
# Constructors.
130132
# ----------------------------------------------------------------------------
131133

132134
def __init__(
133135
self,
134-
config: Optional["akismet.Config"] = None,
136+
config: Optional[akismet.Config] = None,
135137
http_client: Optional[httpx.Client] = None,
136138
) -> None:
137139
"""
@@ -146,7 +148,7 @@ def __init__(
146148
@classmethod
147149
def validated_client(
148150
cls,
149-
config: Optional["akismet.Config"] = None,
151+
config: Optional[akismet.Config] = None,
150152
http_client: Optional[httpx.Client] = None,
151153
) -> Self:
152154
"""
@@ -336,7 +338,7 @@ def _submit(
336338

337339
def comment_check(
338340
self, user_ip: str, **kwargs: Unpack[_common.AkismetArguments]
339-
) -> "akismet.CheckResponse":
341+
) -> akismet.CheckResponse:
340342
"""
341343
Check a piece of user-submitted content to determine whether it is spam.
342344

src/akismet/_test_clients.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
# SPDX-License-Identifier: BSD-3-Clause
88

9+
from __future__ import annotations
10+
911
from http import HTTPStatus
1012
from typing import TYPE_CHECKING, Optional
1113

@@ -222,12 +224,12 @@ class TestAsyncClient(AsyncClient):
222224
223225
"""
224226

225-
comment_check_response: "akismet.CheckResponse" = _common.CheckResponse.HAM
227+
comment_check_response: akismet.CheckResponse = _common.CheckResponse.HAM
226228
verify_key_response: bool = True
227229

228230
def __init__(
229231
self,
230-
config: Optional["akismet.Config"] = None,
232+
config: Optional[akismet.Config] = None,
231233
http_client: Optional[httpx.AsyncClient] = None,
232234
) -> None:
233235
"""
@@ -286,12 +288,12 @@ class TestSyncClient(SyncClient):
286288
287289
"""
288290

289-
comment_check_response: "akismet.CheckResponse" = _common.CheckResponse.HAM
291+
comment_check_response: akismet.CheckResponse = _common.CheckResponse.HAM
290292
verify_key_response: bool = True
291293

292294
def __init__(
293295
self,
294-
config: Optional["akismet.Config"] = None,
296+
config: Optional[akismet.Config] = None,
295297
http_client: Optional[httpx.Client] = None,
296298
) -> None:
297299
"""

0 commit comments

Comments
 (0)