I tried to assign a value to a TaggedList element, but I got the following error:
TypeError: 'builtin_function_or_method' object is not subscriptable
The cause appears to be a mistake in how the index function is called in __setitem__: square brackets are used instead of parentheses. __delitem__ has the same mistake. Compare to __getitem__, which works correctly. The following is from the TaggedList definition in taggedContainers.py from master:
def __getitem__(self, i):
if type(i) == str:
i = self.keys.index(i)
return self.values[i]
def __setitem__(self, i, item):
if type(i) == str:
i = self.keys.index[i]
self.values[i] = item
def __delitem__(self, i):
if type(i) == str:
i = self.keys.index[i]
del self.keys[i]
del self.values[i]
I tried to assign a value to a TaggedList element, but I got the following error:
The cause appears to be a mistake in how the
index
function is called in__setitem__
: square brackets are used instead of parentheses.__delitem__
has the same mistake. Compare to__getitem__
, which works correctly. The following is from the TaggedList definition in taggedContainers.py from master: