Abjad / abjad

Abjad is a Python API for building LilyPond files. Use Abjad to make PDFs of music notation.
https://abjad.github.io
GNU General Public License v3.0
239 stars 39 forks source link

Remove most definitions of __str__() #1434

Closed trevorbaca closed 2 years ago

trevorbaca commented 2 years ago

BREAKING CHANGE.

REMOVED:

abjad.NamedInterval.__str__()
abjad.NamedIntervalClass.__str__()
abjad.NamedPitch.__str__()
abjad.NamedPitchClass.__str__()
abjad.NumberedInversionEquivalentIntervalClass.__str__()
abjad.NumberedInterval.__str__()
abjad.NumberedIntervalClass.__str__()
abjad.NumberedPitch.__str__()
abjad.NumberedPitchClass.__str__()
abjad.Octave.__str__()

abjad.Articulation.__str__()
abjad.BendAfter.__str__()
abjad.Fermata.__str__()
abjad.LaissezVibrer.__str__()
abjad.Markup.__str__()
abjad.Meter.__str__()
abjad.MetricModulation.__str__()
abjad.MetronomeMark.__str__()
abjad.Tag.__str__()
abjad.TimeSignature.__str__()

abjad.CyclicTuple.__str__()

abjad.Chord.__str__()
abjad.MultimeasureRest.__str__()
abjad.Note.__str__()
abjad.NoteHead.__str__()
abjad.Rest.__str__()

The elevation of one attribute to the status of __str__() was always arbitrary in Abjad. Note, too, that Python's dataclass decorator equips classes with a __repr__() but not a __str__().

Use a specific attribute on each object instead of str(). Or use repr().