Skip to content

Allow 'range' to be used with Patterns

Latest
Compare
Choose a tag to compare
@Qirky Qirky released this 03 Jun 16:43
· 1 commit to master since this release

Added range as a valid source of Pattern data e.g.

>>> print(P[range(10)])
P[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> print(Pattern(range(10)))
P[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> print(P[0:4] | range(4,8))
P[0, 1, 2, 3, 4, 5, 6, 7]
>>> print(P[0:4] + range(4,8))
P[4, 6, 8, 10]