Skip to main content

DList for Python (triordinal-dlist)

The list shared by Triordinal's DTree and DGraph: a doubly linked list of names with rational positions, so that "does a come before b?" is a single comparison, O(1).

pip install triordinal-dlist
from triordinal.dlist import DList

q = DList("Q")
q.insert_after("a", "[")      # "[" is the start marker (SOURCE)
q.insert_after("b", "a")
q.precedes("a", "b")          # True

A new element gets the mediant (a+c)/(b+d) of its neighbors a/b and c/d, so normally no other element moves. Only when a mediant cannot be stored, its denominator or numerator exceeding 2⁶¹ (the bound of the C# version, so that both renumber alike), is the smallest surrounding region with enough room renumbered with fractions k/2²⁰; larger regions must be sparser before they are accepted (as in Bender et al., ESA 2002). A block of cells that is cut and pasted elsewhere is placed as a whole and renumbers a region only if it does not fit. Rational positions were Enis Olgac's idea.

DList("Q", positions="integer") gives integer positions instead: midpoints in [0, 2⁶²], as in classical order maintenance, relabeled with the same density rule. They are faster to compare; rational positions are renumbered far less often.

A list may also hold unnamed cells, which have a position but no name; iteration, next/prev and all lookups by name pass over them. DTree uses them as the closing cells that mark the end of each subtree.

Most users install triordinal-dtree (or later triordinal-dgraph), which pulls this package in. MIT License.

Metadata

Release files for triordinal-dlist 2.4.0

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

Source distribution (sdist)

Source distribution for triordinal-dlist 2.4.0
File Size Uploaded Provenance Actions
triordinal_dlist-2.4.0.tar.gz 11.8 kB With provenance Details for triordinal_dlist-2.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for triordinal-dlist 2.4.0
File Interpreter ABI Platform Actions
triordinal_dlist-2.4.0-py3-none-any.whl Python 3 none any Details for triordinal_dlist-2.4.0-py3-none-any.whl

Total release size: 20.1 kB

Release files / triordinal_dlist-2.4.0.tar.gz

Download URL triordinal_dlist-2.4.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3f6e51e6b9d61a5de184bca6e712d4d2fa57060fe11e5b24851a13ec970bb23e
BLAKE2b-256 checksum
How to use checksums
04c212b0d1006796055035e9fe924f887f5b0ad57932a75c782dffdf3632f01f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

Release files / triordinal_dlist-2.4.0-py3-none-any.whl

Download URL triordinal_dlist-2.4.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b363646d3edd389ef98a0b5499f7bcdbeb30536eb73b4d31ca0593565c787b4
BLAKE2b-256 checksum
How to use checksums
e87736041549c898e46ff0e1ecd36c86a5c5081f403f913c4dfdc0ee879fe34d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

Security for triordinal-dlist 2.4.0

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for triordinal_dlist-2.4.0.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 Nov 14, 2026.

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