self.pos is kivy.properties.ObservableReferenceList .
When trying to set this property, it checks that the new value is the same length as the old value.
From kivy.properties.ReferenceProperty :
cdef check(self, EventDispatcher obj, value): cdef PropertyStorage ps = obj.__storage[self._name] if len(value) != len(ps.properties): raise ValueError('%s.%s value length is immutable' % ( obj.__class__.__name__, self.name))
In addition, kivy.properties.ObservableList subclasses list .
Unfortunately, the same is kivy.vector.Vector , and as anyone with experience in Python can tell you, list.__add__ combines its arguments.
This means that the vector is added to self.pos , expanding it, rather than adding it separately, and then causes self.pos complain because its length changes.
This works differently because Vector overloads __add__ to make type additions.
Since python stands for __add__ over __radd__ , all of this fails.
source share