NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3619 most downloaded on PyPI
Type stubs for sortedcontainers
Last release 1 years ago
23 Apr 2025
Release timing varies
gaps range from 3 weeks to 1.5 years
Nearly every release is documented
notes for 4 of 4 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
8 releases · first in 2023
One column per quarter.
Now allows SortedDict(key_fn) where key_fn accepts a non-string key. Previously this call was not matched by any overload, and an explicit iterable ar
SortedDict() constructor:
SortedDict(key_fn) where key_fn accepts a non-string key.
Previously this call was not matched by any overload, and an explicit
iterable argument had to be provided. Thanks to @tomtung for reporting
and helping to fix this. (issue #6, fixed in #11)SortedDict[xxx, yyy](). Previously mypy failed to handle this. (#11)SortedList() constructor:
SortedKeyList() constructor:
SortedKeyList(key_fn), which resulted in a type error at
runtime. Calls without an iterable must be SortedKeyList(key=key_fn).
(issue #10, fixed in#11)SortedKeyList(key=None), which resulted in a type error
at runtime. key is now required to not be None. (issue #12, fixed
in#11)SortedSet() constructor:
Using the SortedList (and the other) types as a function that creates an instance of the type works in pyright now. ([#3], [#4])
Because of the fix to allow pyright to allow using the types as functions, the
constructors with no arguments had to be widened to permit assignment to
non-comparable/hashable types. The result is that it's unfortunately not a
type error to do something like sl: SortedList[type] = SortedList() even
though subsequently adding multiple values to this list will fail at runtime.
It doesn't seem to be possible to type the signature of __new__ to constrain
SortedList() to only allow comparable element types in a standard way (mypy
supported the previous method which worked, but other checkers don't).
The signature definition of SortedDict.setdefault was restructured to satisfy pyright, but the effect of the signature itself remains the same.
pyright runs in CI now
Nothing published for this version
Add __all__ to define the explicit exports of sortedcontainers.sorteddict
__all__ to define the explicit exports of sortedcontainers.sorteddictTypeVar from the __all__ of
sortedcontainers.sortedlistStubs now published as a standalone package from this separate repo.
pytest-mypy-pluginsSortedKeySet and SortedKeyDict which describe the
differences that apply when key functions are used (mirrors SortedKeyList)._reset() (which is documented and used to
change the SortedList load factor for performance reasons).Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →