You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Getting scale results in a list or another data type #81
Is there a way to return scales as lists or tuples? In Python 3.7 only returns an object, like this:
scales.Ionian('C')
<Scale object ('C ionian')>
You can print it, like so:
print(scales.Ionian('C'))
Ascending: C D E F G A B C
Descending: C B A G F E D C
Here are the scales object attributes, none of which produces the actual notes, except the str, which I guess I could perform some operations on to extract the individual notes.
HI @ChapelHeel66! If you want the result as a list, then you can check the ascending() or descending() methods. They are also used in the __str__ implementation that you commented about some kind of reverse engineering.
Maybe we could change the __repr__ method so it returns more information — something like
<Scale object ('C ionian') [C, D, E, F, G, A, B, C]>
Activity
edudobay commentedon Sep 7, 2021
HI @ChapelHeel66! If you want the result as a list, then you can check the
ascending()ordescending()methods. They are also used in the__str__implementation that you commented about some kind of reverse engineering.Maybe we could change the
__repr__method so it returns more information — something likeDo you feel like this could be useful?