Release Notes
1.5.1 (2026-05-25)
- Type annotations:
Fixed
pqdict.fromkeys()being inferred aspqdict[Any, Any]under pyright and ty. The classmethod now uses method-local typevars in@overloadstubs so types are solved from the call arguments.Tightened
pqdict.heapify(key)fromkey: Anytokey: KTvia overloads.
1.5.0 (2026-05-25)
- Type annotations:
Restored generic type parameters:
pqdictis nowpqdict[KT, VT](subclassingMutableMapping[KT, VT]). Keys and values type-check correctly (e.g. when iteratingitems()) and are inferred from constructor input. (#38)An unparameterized
pqdictis treated aspqdict[Any, Any]via PEP 696 type-variable defaults, so it still needs no annotation.Added type overloads so return types are inferred precisely:
pop()yields a key whilepop(key)yields a value; the peek/pop helpers (top,topvalue,topitem,popvalue,popitem) reflect a supplieddefaultin their return type; and theminpq/maxpqconstructors recover their key/value types from the arguments.
- Maintenance:
Dropped support for Python 3.7 and 3.8 (the minimum is now 3.9).
Removed the
importlib-metadatadependency; pqdict now has no runtime dependencies.Import
SelfandTypeVarfromtyping_extensionsunderTYPE_CHECKINGonly, keeping them out of the runtime import path.
- Development:
Migrated development, test, and docs dependencies to PEP 735 dependency groups.
CI and the Read the Docs build now use
uv; the library and test suite are type-checked with mypy, pyright, and ty.Added type checking to CI.
Added a
test_typing.pyregression suite (usingassert_type) that passes under mypy, pyright, and ty.
1.4.1 (2025-09-07)
This release does not change any runtime behavior but updates type annotations and the build backend.
- Maintenance:
Modernized type annotations
Switch to hatchling build system
importlib.metadata for version retrieval
Add timing script for benchmarking
- Development:
napoleon for numpydoc rendering
uv for project management
Full Changelog: https://github.com/nvictus/pqdict/compare/v1.4.0…v1.4.1
1.4.0 (2024-02-14)
- API changes:
The deprecated module-level
minpqandmaxpqhave been removed in favor of same-named classmethods introduced in v1.3.0 (#24)Introduce a distinct
Emptyexception for operations that attempt to remove items from an empty pqdict, instead of raising aKeyError. (Note thatEmptyis derived fromKeyErrorfor subclass compatibility withMapping.popitemandMapping.clear.) (#24)Make internal heap nodes immutable and fast copy as originally proposed by @palkeo in #14
- Maintenance:
Factored out indexed heap operations to reduce redundancy
Better docstrings and type annotations
Full Changelog: https://github.com/nvictus/pqdict/compare/v1.3.0…v1.4.0
1.3.0 (2023-07-01)
This minor release drops support for Python versions <3.7. In turn, we now provide full static type annotations and have migrated to modern package build tools.
- API changes:
Added
popvaluemethod to mirror recenttopvalueaddition.Added
defaultargument totopand support fordefaultusingpopwith PQ semantics. If given, this value is returned when the collection is empty.minpqandmaxpqmodule-level functions are deprecated in favor of pqdict classmethods and will be removed in v1.4.
- Maintenance:
Dropped support for Python 2.7, 3.4, 3.5, and 3.6 (#22).
Inlined type annotations and removed stub file. Thanks for advice from @aqeelat.
Migrate to pyproject.toml.
Linting and static type checking in CI.
1.2.1 (2023-06-26)
- Typing:
Provided typing support (#19) applying stub generated by @noamraph
- Maintenance:
Replaced CI badge.
Dropped Python 2.7 from CI, no longer supported there. Next minor release of pqdict will no longer support Python 2.
1.2.0 (2022-10-14)
- API changes:
Added
topvaluemethod (#17). By @ShivKJ
- Maintenance:
Replaced Travis CI with Github Actions.
1.1.1 (2020-09-21)
- Maintenance:
Performance of
copyimproved by avoiding re-heapifying (#12). By @palkeo.Removed redundant heapify call in constructor.
Removed unused
node_factorykwargs.Formatting with black.
1.1.0 (2020-08-21)
- API changes:
nlargestandnsmallestnow support an optionalkeyparameter (#10). By Eugene Prilepin.
1.0.1 (2020-07-12)
- Maintenance:
Dropped 3.3 support.
Future-proofed for upcoming collections import breakage (#6). By R. Bernstein.
Upgraded test suite from nose to pytest (#7). By R. Bernstein.
1.0.0 (2015-09-02)
Stable release.
Supporting 2.7+, 3.3+ and pypy. Dropped 3.2 support.
0.6 (2015-08-31)
- Conceptual changes:
Clearer terminology in API and documentation (e.g., value vs. priority key).
Functional philosophy: pqdict accepts optional priority key function and precedence function.
- API changes:
PQDict name is deprecated.
Several backwards-incompatible changes to fit the new conceptual model.
Heapsort iterators (iterkeys, itervalues, iteritems) were renamed (popkeys, popvalues, popitems). In Python 2, the old names persist as regular iterators.
Dropped module functions except for nlargest and nsmallest.
- Docs:
Revised and updated
Switch to RTD theme
0.5 (2014-02-09)
- API changes:
PQDict.pq_type property: ‘min’, ‘max’ or ‘custom’
fromkeys keyword ‘sort_by’ is replaced with ‘rank_by’
- Bug fixes:
turns out PQDict.create and sort_by_value were broken! (oops!)
consume: the collector was comparing the wrong pkeys
- Improved test coverage:
improved coverage of unit tests
using travis-ci
0.4 (2013-12-08)
- API changes:
renamed peek() to top()
semantics of top, pop, vs. topitem, popitem, *item, now hopefully more consistent
prioritykeys() and iterprioritykeys() are aliases for values() and itervalues()
new methods: pushpopitem, swap_priority, replace_key
- New functions:
nsmallest, nlargest
consume
Added Sphinx documentation
0.3 (2013-07-23)
- Bug fixes:
off-by one error caused the queue to not reheapify properly in a special case
0.2 (2013-07-18)
- Bug fixes:
Fixed error in __all__ list
0.1 (2013-07-17)
First release.