I'm writing a Python script to parse some data. At the moment I'm trying to make a Class which creates "placeholder" objects. I intend to repeatedly pass each "placeholder" variables, and finally *turn it into* a dict, float, list or string. For reasons that would take a while to describe, it would be a lot easier if I could replace the instance by calling a method.

Here's a simplified example

```
class Event( dict ):

    def __init__( self ):

        self.sumA = 0.0
        self.sumB = 0.0

    def augmentA( self, i ):

        self.sumA += i

    def augmentB( self, i ):

        self.sumB += i

    def seal( self ):

        if self.sumA != 0 and self.sumB != 0:
            self = [ sumA, sumB ]

        elif self.sumA != 0:
            self = float( sumA )

        elif self.sumB != 0:
            self = float( sumB )

```

And what I want to do is:

```
e = Event()
e.augmentA( 1 )
e.augmentA( 2 )
e.seal()

```

...and have 'e' turn into a float.

What I am hoping to avoid is:

```
e = Event()
e.augmentA( 1 )
e.augmentA( 2 )
e = e.getSealedValue()

```

I totally understand that **"self" in my "seal" method is just a local variable**, and won't have any effect on the instance outside scope. I'm unsure however how to achieve what I want, from within the instance, where it would be most convenient for my code. I also understand I could override all the bulit-ins ( **getItem**, **toStr** ) but that complicates my code a lot.

I'm a Python noob so I'm unsure if this is even possible. Indulge me, please :)