From a3aeee624d54eb1c32dee6a431e5b7362db50502 Mon Sep 17 00:00:00 2001 From: Nezar Abdennur Date: Tue, 13 Feb 2024 02:27:17 -0500 Subject: [PATCH] Update docs --- CHANGES | 4 ++-- docs/conf.py | 5 +++++ docs/pqdict.rst | 2 +- pqdict/__init__.py | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index c9cca4a..ec4d92f 100644 --- a/CHANGES +++ b/CHANGES @@ -6,8 +6,8 @@ Release Notes What's changed: -* The deprecated module-level `minpq` and `maxpq` have been removed in favor of same-named classmethods introduced in v1.3.0 (#24) -* Introduce a distinct `Empty` exception for operations that attempt to remove items from an empty pqdict, instead of raising a `KeyError`. (Note that `Empty` is derived from `KeyError` for subclass compatibility with `Mapping.popitem` and `Mapping.clear`.) (#24) +* The deprecated module-level ``minpq`` and ``maxpq`` have been removed in favor of same-named classmethods introduced in v1.3.0 (#24) +* Introduce a distinct ``Empty`` exception for operations that attempt to remove items from an empty pqdict, instead of raising a ``KeyError``. (Note that ``Empty`` is derived from ``KeyError`` for subclass compatibility with ``Mapping.popitem`` and ``Mapping.clear``.) (#24) * Make internal heap nodes immutable and fast copy as originally proposed by @palkeo in #14 Maintenance: diff --git a/docs/conf.py b/docs/conf.py index dbc8589..07fa70d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,6 +41,11 @@ "sphinx.ext.napoleon", ] +# https://sphinx-themes.org/sample-sites/sphinx-rtd-theme/kitchen-sink/api/ +# Automatically extract typehints when specified and place them in +# descriptions of the relevant function/method. +autodoc_typehints = "description" + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/pqdict.rst b/docs/pqdict.rst index 9f3cab6..bc81feb 100644 --- a/docs/pqdict.rst +++ b/docs/pqdict.rst @@ -98,7 +98,7 @@ pqdict class * Remove the top item and return its **key**. * If the pqdict is empty, return ``default`` if provided, otherwise - raise a ``KeyError``. + raise ``Empty``. .. automethod:: popvalue diff --git a/pqdict/__init__.py b/pqdict/__init__.py index 4752f0f..92637b4 100644 --- a/pqdict/__init__.py +++ b/pqdict/__init__.py @@ -227,7 +227,7 @@ def __init__( key: Optional[PrioKeyFn] = None, reverse: bool = False, precedes: PrecedesFn = lt, - ) -> None: + ): """Create a new priority queue dictionary. Parameters