Skip to main content

deque-one

PyPI version License python status downloads

Work-in-progress drop-in replacement for Python's collection.deque with O(1) item access and without sacrificing performance on other metrics.

Getting Started

The easiest way to get deque-one is to:

$ pip install deque-one

Alternatively, you can build it from source:

$ git clone https://github.com/styfenschaer/deque-one.git
$ cd deque-one
$ python setup.py install

The latter requires a C compiler compatible with your Python installation.

Once installed, it behaves like the built-in deque but with O(1) instead of O(n) random item access:

import collections
import deque_one

col_deque = collections.deque(range(1_000_000))
one_deque = deque_one.deque(range(1_000_000))

%timeit col_deque[0]
%timeit one_deque[0]
# 33.6 ns ± 0.422 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)
# 33.3 ns ± 1.08 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)

%timeit col_deque[500_000]
%timeit one_deque[500_000]
# 89.3 µs ± 1.93 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
# 38.2 ns ± 1.45 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)

Implemented Methods

  • __init__ (only first argument)
  • append
  • appendleft
  • pop
  • popleft
  • extend
  • extendleft
  • clear
  • __getitem__
  • __setitem__
  • __len__
  • __repr__
  • __str__

Implemented Properties

  • maxlen (always None)

Metadata

Release files for deque-one 0.0.1

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

Source distribution (sdist)

Source distribution for deque-one 0.0.1
File Size Uploaded
deque-one-0.0.1.tar.gz 16.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for deque-one 0.0.1
File
deque_one-0.0.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
deque_one-0.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64, Linux glibc 2.5+ x86-64 Details
deque_one-0.0.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
deque_one-0.0.1-cp312-cp312-macosx_10_9_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.9+ x86-64 Details
deque_one-0.0.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
deque_one-0.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.5+ x86-64, Linux glibc 2.17+ x86-64 Details
deque_one-0.0.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
deque_one-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
deque_one-0.0.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
deque_one-0.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64, Linux glibc 2.5+ x86-64 Details
deque_one-0.0.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
deque_one-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details

Total release size: 249.3 kB

Release files / deque-one-0.0.1.tar.gz

Download URL deque-one-0.0.1.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c25c8b61893fe0942c4d4d60b4821ba9ec1539fe3daeee56492439a4b045b5c1
BLAKE2b-256 checksum
How to use checksums
bf064d3058bd0ad0cc39309cbade74c3f89cb193da702b0b5d03f3216cc4f7f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp312-cp312-win_amd64.whl

Download URL deque_one-0.0.1-cp312-cp312-win_amd64.whl
Size 15.9 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
4644f363df04dcff3340a5c8f8277790752c2ded5d4bb5f8559ca789b7ae7758
BLAKE2b-256 checksum
How to use checksums
5402bbc539fecb796c9387b79b99c5e61341b5fcb83a3ef9bcf04f2902675cbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL deque_one-0.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 37.1 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
0bd346e0f4d2eafcc4c6fdc42a19646d4fec00e2c9204cc985fb34e9322e3c7a
BLAKE2b-256 checksum
How to use checksums
9287cac76f2bf47501e94ec8bf3e59a8f4f26b8ec081577fee6dbb7b751b208c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL deque_one-0.0.1-cp312-cp312-macosx_11_0_arm64.whl
Size 13.0 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ccd13677c4d5c889bd33bf1cf1823671ddf66ed7e809d1f860e9791f68ca86a5
BLAKE2b-256 checksum
How to use checksums
342716071bb8de0ca6ac99088fe1d985d49f2bbd73829f0217f163903c26e836
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp312-cp312-macosx_10_9_x86_64.whl

Download URL deque_one-0.0.1-cp312-cp312-macosx_10_9_x86_64.whl
Size 12.8 kB
Tags CPython 3.12 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
8809f58c3a75ebbe2a0a349ba1621fef04fb7e0df8c8f1648aaff98cafdc3841
BLAKE2b-256 checksum
How to use checksums
1a4318a3b56278abda5a9e91f911a91a7d6c69f7c7aa14f398b1692a5985de0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp311-cp311-win_amd64.whl

Download URL deque_one-0.0.1-cp311-cp311-win_amd64.whl
Size 15.9 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
9d8d7ad0b9b4cb29b455a92b73d43f5f0f578497c3a17c23e0c68e65dec6bfb1
BLAKE2b-256 checksum
How to use checksums
cc60c28d09e973d9b32158b4dd779e2d44cdeaae20150ac849534b7161f20619
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL deque_one-0.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 36.3 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
0aef2de8e5c69d2f6f473797a752631f9a144d0341cce2cc883a969fa66a284c
BLAKE2b-256 checksum
How to use checksums
ecd91bfa1dcfe0d1339bf7993c60cb936d976600c71ebab700666c8677758a7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL deque_one-0.0.1-cp311-cp311-macosx_11_0_arm64.whl
Size 12.9 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
52f215958ca8c3e31385ae664b50fa09e147aa4385c18a587b265fc31d8649cb
BLAKE2b-256 checksum
How to use checksums
442e4e7cfaa0c2bcb8122df0651180cfc3c2fe7af75d9fb2d03d3b9e139f9728
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl

Download URL deque_one-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl
Size 12.7 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
074b59dfc79a474270869cdcb6d4b4a2317b0d750ec1950e1928215c850e02d7
BLAKE2b-256 checksum
How to use checksums
f125f6da2971877b25385c7591ef1b4ed8b4e018cc6d93a824e96d7957a08ce5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp310-cp310-win_amd64.whl

Download URL deque_one-0.0.1-cp310-cp310-win_amd64.whl
Size 15.9 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
848914869c36154e30a5915a2224936025404f0ac37bcede974642d7e548a89c
BLAKE2b-256 checksum
How to use checksums
428b159d9a34086b2d7afe1d65dc743e761ec88c096445b56e0171df8f314508
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL deque_one-0.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 34.7 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
6f657f26435b77c756aa6835f408a00b61432832f12bbf2dd1b74b56eb7cda9a
BLAKE2b-256 checksum
How to use checksums
90a2fe7f6d9b5a866bfba449888cf09f6aa06eb21ff027cbdc1783ed68f4ee29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL deque_one-0.0.1-cp310-cp310-macosx_11_0_arm64.whl
Size 12.9 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
eb00a93b6368e608de2cef2a386fb8be3ee8b271e760a989edaabc702eb57384
BLAKE2b-256 checksum
How to use checksums
d71260708a6a094f39af8a3762cbc7e790dbf143b0042833a83e68fa20f19c6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release files / deque_one-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl

Download URL deque_one-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl
Size 12.7 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
74185316d248f079cf5a25067be2167ca9620be06f3fe6f235edb69fd958ee26
BLAKE2b-256 checksum
How to use checksums
c97abd7821a19a1158e781fa2232f27fbd68467a549201b1091dd9f90766e8f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release history Release notifications | RSS feed

This release

0.0.1 This release

13 release files

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