Tools for encoding/decoding sequence editions (insertions/deletions) in compact forma
Project description
Sequence Edits
Tools for encoding/decoding sequence editions (insertions/deletions) in compact forma
Edits
class Skip:
idx: int
class Insert:
idx: int
value: T
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.5.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for sequence_edits-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | baa03c58d2b382d4a57aeb991a9cc1d4a7185f1b4a0563e4d564ae321bfbe823 |
|
MD5 | b509ebc6357a7a41eab87103cfb088b8 |
|
BLAKE2b-256 | 8b529e284f86c483f14679159762f1c033e5490aeaacf0bbb347004fe8d04130 |