Skip to main content

Compressed representation of sequence edits

Project description

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']

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

sequence_edits-0.1.9.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

sequence_edits-0.1.9-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file sequence_edits-0.1.9.tar.gz.

File metadata

  • Download URL: sequence_edits-0.1.9.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for sequence_edits-0.1.9.tar.gz
Algorithm Hash digest
SHA256 0e42609602fa54802edc53ee1634f170e67485b277bb5c04238d25e9550890f3
MD5 7fce406ef89f0014f7abd64a194487b3
BLAKE2b-256 3c2726ff50b35107effaa5e55b643ca4d7ab649cb8a69c85a6101ff25437637c

See more details on using hashes here.

File details

Details for the file sequence_edits-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for sequence_edits-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 19006b4f4a64656bc5525699994e4a4037c7390baf0d1df118d26ae8326db9e1
MD5 320fa46d62ef2e1abd242f73b29fdd9a
BLAKE2b-256 5cd7463a2afb3ea7f9ba46094fc3d28fc64bb293e4a9d9d97b28d62c3558d4aa

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