fictive.patterns.sequences module

Common patterns for working with sequence objects

Functions

append_distinct

combine current and any values from new not already in current

fictive.patterns.sequences.append_distinct(current: Sequence, new: Sequence)[source]

combine current and any values from new not already in current

>>> from fictive.patterns.sequences import append_distinct
>>> current = (2, 4, 6, 8, 10)
>>> new = [1, 2, 3, 4, 5]
>>> append_distinct(current, new)
(2, 4, 6, 8, 10, 1, 3, 5)
Parameters
Returns

the new sequecne

Return type

the same type as current