Problem removing NodePath

This is a class i use to represent a simple crystal, that can be picked up by the player:

class Crystal():
    def __init__(self, x, y, z, h, p, r):
        self=loader.loadModel('Models/crystal')
        self.setPosHpr(x, y, z, h, p, r)
        self.setTag('pick', 'crys10')
        self.reparentTo(render)

In the player class i set up a collisionHandlerEvent that throws an event when an objects tagged ‘pick’ is touched; the event is accepted and a counter is updated, then the object should be removed.
I coded it this way:

def pickUp(self, cEntry):#cEntry is the collisionEntry
        node=cEntry.getIntoNodePath()
        tag=node.getNetTag('pick')
        print tag
        if tag[0:4]=='crys':
            self.crystals+=int(tag[4:])
            node.removeNode()
            print self.crystals

The problem is that the crystal doesn’t go away from my scene!The behaviour is right, except that the node should not exist anymore, and the model keeps showing in the rendering.
I even tried making Crystal class inheriting from NodePath, without result.

I really don’t know what I’m missing.

Thank you and happy new year!

I’m really sorry for having posted trash, I found my error: i was calling flattenStrong on my scene, so those non-static geometries were flattened in my environment.
Mine was a logic error.

EDIT
I changed the behaviour of the flattening, and the crystals do not get flattened anymore; even though, the problem remains!

This is your first mistake :

def __init__(self, x, y, z, h, p, r):
    self=loader.loadModel('Models/crystal')

self is just a key in init’s local dictionary.
Assigning something else to self doesn’t replace Crystal instance. So, after that assignment line, you’ve lost the instance and operate only at that model nodepath level.

To prove it, try this :

class correct:
  def __init__(s):
      s.me="I'm Ausir"

class wrong:
  def __init__(s):
      s=lambda:0
      s.me="I'm Ausir"

print correct().me
print wrong().me

In wrong class, attribute me is given to that empty function (lambda:0), instead of wrong class instance.

To solve your case, I’d do this :

class Crystal():
    def __init__(self, x, y, z, h, p, r):
        self.model = model = loader.loadModel('Models/crystal')
        model.setPosHpr(x, y, z, h, p, r)
        model.setTag('pick', 'crys10')
        model.setPythonTag('removeFunc', self.onRemove)
        model.reparentTo(render)

    def onRemove(self):
        self.model.removeNode()
        print 'crystal removed',self.model

def pickUp(self, cEntry):#cEntry is the collisionEntry
    node=cEntry.getIntoNodePath()
    tag=node.getNetTag('pick')
    print tag
    if tag[0:4]=='crys':
        self.crystals+=int(tag[4:])
        node.getNetPythonTag('removeFunc')()
        print self.crystals

Thank you ynjh_jo that worked great!