docs: somewhat fix references in source code

This commit is contained in:
Mike A.
2025-08-04 16:16:30 +02:00
parent ea880d5d49
commit def535f819
12 changed files with 113 additions and 109 deletions

View File

@@ -19,9 +19,9 @@ class Closable(ABC):
def __init__(self, loop: asyncio.AbstractEventLoop | None = None) -> None:
"""
Initialize the ``Closable``.
Initialize the :class:`Closable`.
If an event loop is given, the ``Closable`` will attempt to close itself
If an event loop is given, the :class:`Closable` will attempt to close itself
using the loop when it is garbage collected.
"""
self._loop: asyncio.AbstractEventLoop | None = loop
@@ -57,7 +57,7 @@ class Serializable(Generic[_T], ABC):
If an argument is provided, the output will also be written to that file.
The output of this method is guaranteed to be JSON-serializable, and passing
the return value of this function as an argument to `Serializable.from_json`
the return value of this function as an argument to :meth:`Serializable.from_json`
will always result in an exact copy of the internal state as it was when exported.
You are encouraged to save and load object states to and from disk whenever possible,
@@ -69,11 +69,11 @@ class Serializable(Generic[_T], ABC):
@abstractmethod
def from_json(cls, val: str | Path | _T, /) -> Self:
"""
Restore state from a previous `Closable.to_json` export.
Restore state from a previous :meth:`Closable.to_json` export.
If given a str or Path, it must point to a json file from `Serializable.to_json`.
If given a str or Path, it must point to a json file from :meth:`Serializable.to_json`.
Otherwise, it should be the Mapping itself.
See `Serializable.to_json` for more information.
See :meth:`Serializable.to_json` for more information.
"""
raise NotImplementedError