From 26151315fc7c8ed62d448623a853afdd32cd579c Mon Sep 17 00:00:00 2001 From: Colm Ryan Date: Tue, 12 Jul 2016 10:06:15 -0400 Subject: [PATCH] CompositePulses are now iterable too with @blakejohnson --- QGL/PatternUtils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QGL/PatternUtils.py b/QGL/PatternUtils.py index 43c52b17..4d64cf10 100644 --- a/QGL/PatternUtils.py +++ b/QGL/PatternUtils.py @@ -278,7 +278,7 @@ def convert_lengths_to_samples(instructions, samplingRate, quantization=1): # from Stack Overflow: http://stackoverflow.com/questions/2158395/flatten-an-irregular-list-of-lists-in-python/2158532#2158532 def flatten(l): for el in l: - if isinstance(el, collections.Iterable) and not isinstance(el, (str, Pulse)) : + if isinstance(el, collections.Iterable) and not isinstance(el, (str, Pulse, CompositePulse)) : for sub in flatten(el): yield sub else: