Skip to main content

sortedcontainers-stubs

Community-maintained Python type stubs for the sortedcontainers Python library. sortedcontainers provides dict, set and list data structures that maintain the order of their elements by value (not by insertion order).

The sortedcontainers API has some differences and additional methods compared to regular Python dict, set and list types, and has additional requirements for keys/values on whether they need to be hashable or comparable. These type stubs allow type checkers to enforce these details, which makes sortedcontainers easier to use.

Install

$ pip install sortedcontainers-stubs

Once you've installed the package, mypy (or other tools) should automatically find the types without any configuration.

Usage Notes

sortedcontainers.sorteddict.SortedKeyDict and sortedcontainers.sortedset.SortedKeySet are stub-only subclasses of SortedDict and SortedSet — they don't exist at runtime. They exist as type stubs to describe the different return types of the SortedDict and SortedSet constructors, which vary depending if a key function is used or not.

However, sortedcontainers.sortedlist.SortedKeyList is a real type that exists at runtime.

Version numbers

The sortedcontainers-stubs major and minor versions correspond to major and minor versions of sortedcontainers. The patch number increments independently if required to fix an issue. So if you're using sortedcontainers 2.4.X, use the latest 2.4.X version of sortedcontainers-stubs.

Currently sortedcontainers-stubs version 2.4.0 has dependency metadata supporting sortedcontainers >=2,<3 as there are minimal API differences so far since 2.0.

Reporting Issues

Report issues with type stubs here, at the sortedcontainers-stubs issues, not at the sortedcontainers repo.

History

These stubs were initially offered to sortedcontainers in a PR. After some discussion, the sortedcontainers developer, Grant Jenkins, indicated they'd prefer to keep the sortedcontainers codebase without type annotations, and publish the type stubs in a separate package. This repo is based on the stubs from that PR.

Metadata

Release files for sortedcontainers-stubs 2.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sortedcontainers-stubs 2.4.3
File Size Uploaded Provenance
sortedcontainers_stubs-2.4.3.tar.gz 6.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sortedcontainers-stubs 2.4.3
File Interpreter ABI Platform
sortedcontainers_stubs-2.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 15.0 kB

Release files / sortedcontainers_stubs-2.4.3.tar.gz

Download URL sortedcontainers_stubs-2.4.3.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ba172daceda4bd617d2f6ffd24582261a494da92705409651967faa40ebc75dd
BLAKE2b-256 checksum
How to use checksums
19132940fafc136048ec99c932bf0077613f1ae4693a313705162982335fe5fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 23, 2025.

Transparency log

Release files / sortedcontainers_stubs-2.4.3-py3-none-any.whl

Download URL sortedcontainers_stubs-2.4.3-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4496109dfa6645e4b675f57fbc7e42ec4d1bed2c74aab7fa379e0795e49fe406
BLAKE2b-256 checksum
How to use checksums
873eb0fbd7621e6430d33d234ad5e2dc9b0d4df575518f4790a2af934e1029ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 23, 2025.

Transparency log

Security for sortedcontainers-stubs 2.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sortedcontainers_stubs-2.4.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 23, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page