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.6.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for sequence_edits-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffe0e778bff8f661489c454d30cb5b7ab99186bd80c68aa03c937863fc6eb935 |
|
MD5 | 9b8140a11f086de8da2eb0cf26c17a22 |
|
BLAKE2b-256 | f1659c46bcba22dd0a0b3495f02a86c5a69a215476ab5315c723eed2d6314b78 |