Skip to main content

a simple, type checkable, sorted list

Project description

sortedlist

A simple sorted list that maintains its sortedness under all operations:

  • Based on Python's built-in sort algorithm and the bisect standard library
  • Fully type checked using mypy --strict
  • No dependencies
  • Nothing fancy

This library offers two classes:

SortedList

This class implements most methods of Python's built-in list, except those that don't make sense for sorted data. For example: insert() and append() are replaced by an add() method that uses bisect to quickly find the appropriate place in the list for the new value.

SortedListByKey

This class is much the same as SortedList (and inherits from it). However, during construction it accepts sorting function as key parameter, used to sort the data with the help of an arbitrary callable you can supply.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

srtlst-0.1.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

srtlst-0.1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file srtlst-0.1.1.tar.gz.

File metadata

  • Download URL: srtlst-0.1.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.2 Darwin/20.6.0

File hashes

Hashes for srtlst-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e974a58304a61bb8adae82cccdf400a7b831895644a3772813e0bbc921a5fab4
MD5 e8bc973af98ccf3c60891fcef5aa804b
BLAKE2b-256 8dbd8cecd15e536da2629231bbd197c0d7438589d367994318f37506be5eea5c

See more details on using hashes here.

File details

Details for the file srtlst-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: srtlst-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.2 Darwin/20.6.0

File hashes

Hashes for srtlst-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a111c7768480c6ada5d72c336146753fb8533316a61b370407e60face6355529
MD5 740e89335b3be2f1be1325aa1edeea17
BLAKE2b-256 cf4b8e9800074820f167d5e75c2cd479348add8e48bd9eeaa718f427d13c102d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page