Skip to content
Snippets Groups Projects
Commit 170490ab authored by Martin Bauer's avatar Martin Bauer
Browse files

Fix: different index representation lead to wrong Field.access equality

for fields without index dimensions the indices (0,) and () have been
treated equivalently, but did not compare equal
parent 5f279c64
Branches
Tags
No related merge requests found
......@@ -362,7 +362,11 @@ class Field(object):
raise ValueError("Indexing an already indexed Field.Access")
idx = tuple(idx)
if len(idx) != self.field.indexDimensions and idx != (0,):
if self.field.indexDimensions == 0 and idx == (0,):
idx = ()
if len(idx) != self.field.indexDimensions:
raise ValueError("Wrong number of indices: "
"Got %d, expected %d" % (len(idx), self.field.indexDimensions))
return Field.Access(self.field, self._offsets, idx)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment