Skip to content

Commit 13292f4

Browse files
committed
fix bug seen by Samuel
1 parent abe4b15 commit 13292f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

neo/core/objectlist.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def _handle_append(self, obj):
3939
raise Exception("Objects in groups should not link to the group as their parent")
4040
current_parent = getattr(obj, relationship_name)
4141
if current_parent != self.parent:
42+
# use weakref here? - see https://github.com/NeuralEnsemble/python-neo/issues/684
4243
setattr(obj, relationship_name, self.parent)
4344

4445
def __str__(self):
@@ -101,7 +102,7 @@ def index(self, value, start=0, stop=sys.maxsize):
101102

102103
def insert(self, index, obj):
103104
self._handle_append(obj)
104-
self.contents[index] = obj
105+
self.contents.insert(index, obj)
105106

106107
def pop(self, index=-1):
107108
return self.contents.pop(index)

0 commit comments

Comments
 (0)