Socket
Socket
Sign inDemoInstall

sequence-edits

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sequence-edits

Compressed representation of sequence edits


Maintainers
1

Sequence Edits

Compressed representation of sequence edits

Edits

class Skip:
  id: int
  tag = 'skip'

class Insert:
  idx: int
  value: T
  tag = 'insert'

Edit = Skip | Insert

All edits are applied w.r.t. the original list. So, order of edits only affects the order in which values are insterted to a same index.

Usage

import sequence_edits as se

edits = [
  se.Insert(idx=1, value='the'),
  se.Skip(idx=4)
]
xs = ['And',      'earth', 'was', 'without', 'no', 'form']
list(se.apply(edits, xs))
#  ['And', 'the', 'earth', 'was', 'without',       'form']

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc