MCPcopy Create free account
hub / github.com/bspaans/python-mingus / __setitem__

Method __setitem__

mingus/containers/suite.py:73–81  ·  view source on GitHub ↗

Enable the '[] =' notation.

(self, index, value)

Source from the content-addressed store, hash-verified

71 return self.compositions[index]
72
73 def __setitem__(self, index, value):
74 """Enable the '[] =' notation."""
75 if not hasattr(value, "tracks"):
76 raise UnexpectedObjectError(
77 "Object '%s' is not expected. "
78 "Expecting a "
79 "mingus.containers.Composition object." % value
80 )
81 self.compositions[index] = value
82
83 def __add__(self, composition):
84 """Enable the '+' operator for Compositions."""

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected