I need to use Python nampai records for access speed and memory savings. But it lacks the ability to set member functions (methods) to these records. For example, I want to do this:
X=ones(3, dtype=dtype([('foo', int), ('bar', float)])) X[1].incrementFooBar() If there were just objects, I would do this:
class QQQ: ... def incrementFooBar(self): self.foo+=1 self.bar+=1 pass X=[QQQ(),QQQ(),QQQ()] X[1].incrementFooBar() How to do the same thing, but with nampai records?
X[1].incrementFooBar(), instead ofincrementFooBar(X[1])? - MaxU