You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

circulartape

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

circulartape

A circular linked list implementation

0.0.3
pipPyPI
Maintainers
1

circulartape

It's a node-oriented circular linked list implementation.

Source: phab.tris.fyi.

Example

from circulartape import Tape

one = Tape("one")  # one.to_list() == ["one"]
two = one.insert("two")  # one.to_list() == ["one", "two"]
three = two.insert("three")  # one.to_list() == ["one", "two", "three"]

two.remove()  # one.to_list() == ["one", "three"]

# You can build a long list and seek through it n nodes at a time:
one = Tape(1)
current = one
for i in range(2, 100):
    current = current.insert(i)

one.seek(30).data  # => 31

# Use negative values to seek backwards.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts