Enable the '[] =' notation for Tracks. Throw an UnexpectedObjectError if the value being set is not a mingus.containers.Bar object.
(self, index, value)
| 206 | return self.bars[index] |
| 207 | |
| 208 | def __setitem__(self, index, value): |
| 209 | """Enable the '[] =' notation for Tracks. |
| 210 | |
| 211 | Throw an UnexpectedObjectError if the value being set is not a |
| 212 | mingus.containers.Bar object. |
| 213 | """ |
| 214 | if not hasattr(value, "bar"): |
| 215 | raise UnexpectedObjectError( |
| 216 | "Unexpected object '%s', " |
| 217 | "expecting a mingus.containers.Barobject" % value |
| 218 | ) |
| 219 | self.bars[index] = value |
| 220 | |
| 221 | def __repr__(self): |
| 222 | """Return a string representing the class.""" |
nothing calls this directly
no test coverage detected