Skip to content

Commit

Permalink
Make pagination docs friendlier to subclasses
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rra committed Nov 26, 2024
1 parent d2e49a7 commit 4359966
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions safir/src/safir/database/_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -127,7 +127,7 @@ def from_entry(cls, entry: E, *, reverse: bool = False) -> Self:
Returns
-------
PaginationCursor
safir.database.PaginationCursor
Requested cursor.
"""

Expand All @@ -148,7 +148,7 @@ def from_str(cls, cursor: str) -> Self:
Raises
------
InvalidCursorError
safir.database.InvalidCursorError
Raised if the cursor is invalid.
"""

Expand Down

0 comments on commit 4359966

Please sign in to comment.