Skip to main content

cllist is an extension module for CPython providing basic linked list data structures.

Collections implemented in the llist module perform well in problems which rely on fast insertions, pops, and removal of elements in the middle of a sequence.

For this kind of workload, they can be significantly faster than collections.deque or standard Python lists.

This project was forked from https://github.com/ajakubek/python-llist

and adds many features and enhancements to the original, under a new name “cllist”.

The cllist version now lives at https://github.com/kata198/python-cllist

If you were using the previous module, you can change to this new module, it is completely backwards (but not forwards) compatible.

Single Linked List

Singly linked lists are provided by the “sllist” module. This is your basic single-linked list, and might be useful for some scenarios.

A single linked list is far less efficient at everything than the double-linked list implementation.

Double Linked List

A double-linked list is provided by the “dllist” module.

This provides great performance when doing pops and insertions at random (in the middle), or at either end.

This implementation has been enhanced by implementing a “middle” marker.

This “middle” marker is used when the list size exceeds 10 elements, and is used in all operations which involve walking the list,

which ensures that AT MOST N/4 elements will need to be walked (so the shortest distance from either start, middle, or end is calculated, and walked from there).

This additional feature makes this linked list much more efficient on larger data sets than a standard double-linked list implementation.

Why use a linked list?

A linked list should be used when you are going to be adding or removing elements in the middle of the dataset. A standard python list forces the entire list to be reallocated and copied when such happens, whereas this can do so without reallocating.

Documentation

Documentation can be found at: https://pythonhosted.org/cllist/

Release files for cllist 1.1.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 cllist 1.1.0
File Size Uploaded
cllist-1.1.0.tar.gz 46.4 kB Details

Release files / cllist-1.1.0.tar.gz

Download URL cllist-1.1.0.tar.gz
Size 46.4 kB
Tags Source
SHA-256 checksum
How to use checksums
12161416863ced28a388a8eb271427ed849b4e378a81a245925c1b1fd605b95d
BLAKE2b-256 checksum
How to use checksums
ebf0188b2a147e3de7f9b2d01b290748162fd6c9776fbb7162304b9662afb79b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.0 This release

1 release file

1.0.2

4 release files

1.0.0

1 release file

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