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?

  • 2
    I vote for closing this question as not relevant, because the question must be asked in Russian. - VenZell
  • MaxU, "this" is not relevant. - al.zatv
  • one
    How important is it for you to be able to call a function like X[1].incrementFooBar() , instead of incrementFooBar(X[1]) ? - MaxU

0