Skip to content

Commit

Permalink
CompositePulses are now iterable too
Browse files Browse the repository at this point in the history
  • Loading branch information
caryan committed Jul 12, 2016
1 parent f259e23 commit 2615131
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion QGL/PatternUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2615131

Please sign in to comment.