Type stubs for sortedcontainers
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sortedcontainers_stubs-2.4.3.tar.gz.
File metadata
- Download URL: sortedcontainers_stubs-2.4.3.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba172daceda4bd617d2f6ffd24582261a494da92705409651967faa40ebc75dd
|
|
| MD5 |
fde696cae49940497b249576b255cf31
|
|
| BLAKE2b-256 |
19132940fafc136048ec99c932bf0077613f1ae4693a313705162982335fe5fb
|
Provenance
The following attestation bundles were made for sortedcontainers_stubs-2.4.3.tar.gz:
Publisher:
publish.yml on h4l/sortedcontainers-stubs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sortedcontainers_stubs-2.4.3.tar.gz -
Subject digest:
ba172daceda4bd617d2f6ffd24582261a494da92705409651967faa40ebc75dd - Sigstore transparency entry: 201255998
- Sigstore integration time:
-
Permalink:
h4l/sortedcontainers-stubs@41d5b6c2b90b1f1b7c38e7409647f9cb4a9830ae -
Branch / Tag:
refs/tags/v2.4.3 - Owner: https://github.com/h4l
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@41d5b6c2b90b1f1b7c38e7409647f9cb4a9830ae -
Trigger Event:
push
-
Statement type:
File details
Details for the file sortedcontainers_stubs-2.4.3-py3-none-any.whl.
File metadata
- Download URL: sortedcontainers_stubs-2.4.3-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4496109dfa6645e4b675f57fbc7e42ec4d1bed2c74aab7fa379e0795e49fe406
|
|
| MD5 |
6f43dd795e5975de76e96e1f45cb6e25
|
|
| BLAKE2b-256 |
873eb0fbd7621e6430d33d234ad5e2dc9b0d4df575518f4790a2af934e1029ea
|
Provenance
The following attestation bundles were made for sortedcontainers_stubs-2.4.3-py3-none-any.whl:
Publisher:
publish.yml on h4l/sortedcontainers-stubs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sortedcontainers_stubs-2.4.3-py3-none-any.whl -
Subject digest:
4496109dfa6645e4b675f57fbc7e42ec4d1bed2c74aab7fa379e0795e49fe406 - Sigstore transparency entry: 201256005
- Sigstore integration time:
-
Permalink:
h4l/sortedcontainers-stubs@41d5b6c2b90b1f1b7c38e7409647f9cb4a9830ae -
Branch / Tag:
refs/tags/v2.4.3 - Owner: https://github.com/h4l
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@41d5b6c2b90b1f1b7c38e7409647f9cb4a9830ae -
Trigger Event:
push
-
Statement type: