Let's say I have a class in Python:

```
class Foo(object):
    a = 1
    b = 2

```

I'd like to do some extra stuff when I access 'a' but NOT 'b'. So, for example, let's assume that the extra stuff I'd like to do is to increment the value of the attribute:

```
> f = Foo()
> f.a # Should output 2
> f.a # Should output 3
> f.a # Should output 4
> f.b # Should output 2, since I want the extra behavior just on 'a'

```

It feels like there is a way through \_\_getattr\_\_ or \_\_getattribute\_\_, but I couldn't figure that out.

The extra thing can be anything, not necessarily related to the attribute (like print 'Hello world').

Thanks.