@@ -1881,7 +1881,9 @@ def splitElementsToCompleteTuplets(
18811881 New in v7.3.
18821882
18831883 >>> from music21.stream.makeNotation import splitElementsToCompleteTuplets
1884- >>> s = stream.Stream([note.Note(quarterLength=1/3), note.Note(quarterLength=1), note.Note(quarterLength=2/3)])
1884+ >>> s = stream.Stream(
1885+ ... [note.Note(quarterLength=1/3), note.Note(quarterLength=1), note.Note(quarterLength=2/3)]
1886+ ... )
18851887 >>> splitElementsToCompleteTuplets(s)
18861888 >>> [el.quarterLength for el in s.notes]
18871889 [Fraction(1, 3), Fraction(2, 3), Fraction(1, 3), Fraction(2, 3)]
@@ -1897,10 +1899,10 @@ def splitElementsToCompleteTuplets(
18971899 [Fraction(1, 6), Fraction(1, 3), Fraction(1, 3), Fraction(1, 6)]
18981900 '''
18991901 if recurse :
1900- iter = s .recurse (streamsOnly = True , includeSelf = True )
1902+ iterator = s .recurse (streamsOnly = True , includeSelf = True )
19011903 else :
1902- iter = [s ]
1903- for container in iter :
1904+ iterator = [s ]
1905+ for container in iterator :
19041906 general_notes = list (container .notesAndRests )
19051907 last_tuplet : Optional ['music21.duration.Tuplet' ] = None
19061908 partial_tuplet_sum = 0.0
@@ -1943,7 +1945,7 @@ def consolidateCompletedTuplets(
19431945 that are unnecessarily expressed as tuplets and replace them with a single
19441946 element. These groups must:
19451947
1946- - be consecutive (with respect to the sequence of :class:`~music21.note.GeneralNote` objects)
1948+ - be consecutive (with respect to :class:`~music21.note.GeneralNote` objects)
19471949 - be all rests, or all :class:`~music21.note.NotRest`s with equal `.pitches`
19481950 - all have :attr:`~music21.duration.Duration.expressionIsInferred` = `True`.
19491951 - sum to the tuplet's total length
@@ -1999,10 +2001,10 @@ def is_reexpressible(gn: note.GeneralNote) -> bool:
19992001 )
20002002
20012003 if recurse :
2002- iter = s .recurse (streamsOnly = True , includeSelf = True )
2004+ iterator = s .recurse (streamsOnly = True , includeSelf = True )
20032005 else :
2004- iter = [s ]
2005- for container in iter :
2006+ iterator = [s ]
2007+ for container in iterator :
20062008 reexpressible = [gn for gn in container .notesAndRests if is_reexpressible (gn )]
20072009 to_consolidate : List ['music21.note.GeneralNote' ] = []
20082010 partial_tuplet_sum = 0.0
0 commit comments