Skip to content

Commit afb6b39

Browse files
committed
Fix a picky type-checker issue.
Officially, TypedDict can't be cast to dict, but can be cast to Mapping, so treating this argument as Mapping silences IDE type-checkers.
1 parent 67c94eb commit afb6b39

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/akismet/_common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import os
1010
import sys
1111
import textwrap
12+
from collections.abc import Mapping
1213
from importlib.metadata import version
1314
from typing import Literal, NamedTuple, NoReturn, TypedDict, cast
1415

@@ -256,7 +257,7 @@ def _handle_verify_key_response(response: httpx.Response) -> bool:
256257
_protocol_error(_VERIFY_KEY, response)
257258

258259

259-
def _prepare_post_kwargs(kwargs: dict, endpoint: str) -> AkismetArguments:
260+
def _prepare_post_kwargs(kwargs: Mapping, endpoint: str) -> AkismetArguments:
260261
"""
261262
Verify that the provided set of keyword arguments is valid for an Akismet POST
262263
request, returning them if they are or raising UnknownArgumentError if they aren't.

0 commit comments

Comments
 (0)