Skip to content

Commit

Permalink
Change the Config object back to namedtuple.
Browse files Browse the repository at this point in the history
It was one originally, then changed to a dataclass, but I have a
slight preference for it being a namedtuple, since it's meant to be
that sort of "struct" or "record" container type.
  • Loading branch information
ubernostrum committed Dec 28, 2023
1 parent b3a9023 commit 7abbeb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Alternative configuration
If you don't want to configure your Akismet client via the standard environment
variables, or aren't able to set the environment variables, you can avoid the
``validated_client()`` method and instantiate your Akismet client
directly. This is done via the :class:`akismet.Config` utility dataclass. You
directly. This is done via the :class:`akismet.Config` utility tuple. You
should also the make sure to validate the configuration before trying to use
the client.

Expand Down
7 changes: 3 additions & 4 deletions src/akismet/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""
# SPDX-License-Identifier: BSD-3-Clause

import dataclasses
import enum
import os
import sys
Expand Down Expand Up @@ -83,10 +82,10 @@ class CheckResponse(enum.IntEnum):
DISCARD = 2


@dataclasses.dataclass
class Config:
class Config(typing.NamedTuple):
"""
An Akismet configuration, consisting of a key and a URL.
A :func:`~collections.namedtuple` representing Akismet configuration, consisting
of a key and a URL.
You only need to use this if you're manually configuring an Akismet API client
(which should be rare) rather than letting the ``validated_client()`` constructor
Expand Down

0 comments on commit 7abbeb7

Please sign in to comment.