mirror of
https://github.com/malmeloo/FindMy.py.git
synced 2026-04-18 00:53:56 +02:00
docs: somewhat fix references in source code
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user