From 435996660ec71e81190ffe1eb5d6927ad1ef8765 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Tue, 26 Nov 2024 13:52:28 -0800 Subject: [PATCH] Make pagination docs friendlier to subclasses Safir really struggles to resolve references in inherited docstrings when they reference the context of the upstream module from which they are inherited. Use absolute references in the docstrings for the pagination code in the hope that this will be friendlier to downstream projects using Sphinx. --- safir/src/safir/database/_pagination.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/safir/src/safir/database/_pagination.py b/safir/src/safir/database/_pagination.py index 5ac7caa1..b6c96f5c 100644 --- a/safir/src/safir/database/_pagination.py +++ b/safir/src/safir/database/_pagination.py @@ -113,10 +113,10 @@ def from_entry(cls, entry: E, *, reverse: bool = False) -> Self: Builds a cursor to get the entries after the provided entry, or before the provided entry if ``reverse`` is set to `True`. When the cursor is - later applied with `apply_cursor`, forward cursors (the default) must - include the entry the cursor was based on. Reverse cursors must - exclude the given entry and return data starting with the entry - immediately previous. + later applied with `~safir.database.PaginationCursor.apply_cursor`, + forward cursors (the default) must include the entry the cursor was + based on. Reverse cursors must exclude the given entry and return data + starting with the entry immediately previous. Parameters ---------- @@ -127,7 +127,7 @@ def from_entry(cls, entry: E, *, reverse: bool = False) -> Self: Returns ------- - PaginationCursor + safir.database.PaginationCursor Requested cursor. """ @@ -148,7 +148,7 @@ def from_str(cls, cursor: str) -> Self: Raises ------ - InvalidCursorError + safir.database.InvalidCursorError Raised if the cursor is invalid. """