Skip to content

Commit 04d8d3a

Browse files
committed
[property.py] Remove Negative Index on Value Insert
1 parent 522ac81 commit 04d8d3a

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

odml/property.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -929,17 +929,9 @@ def insert(self, index, obj, strict=True):
929929
raise ValueError("odml.Property.insert: passed value(s) cannot be converted "
930930
"to data type \'%s\'!" % self._dtype)
931931

932-
933932
if index > len(self._values):
934933
warnings.warn("odml.Property.insert: Index %i larger than length of property.values. "
935934
"Added value at end of list." % index, stacklevel=2)
936-
elif index < - len(self._values) - 1:
937-
warnings.warn("odml.Property.insert: Negative index %i smaller than length "
938-
"of property.values. "
939-
"Added value at beginning of list." % index, stacklevel=2)
940-
941-
if -len(self._values) <= index < 0:
942-
index = len(self._values) + index + 1
943935

944936
self._values.insert(index, dtypes.get(new_value[0], self.dtype))
945937

0 commit comments

Comments
 (0)