I have the following python code:

```
class FooMeta(type):
    def __setattr__(self, name, value):
        print name, value
        return super(FooMeta, self).__setattr__(name, value)

class Foo(object):
    __metaclass__ = FooMeta
    FOO = 123
    def a(self):
        pass

```

I would have expected `__setattr__` of the meta class being called for both `FOO` and `a`. However, it is not called at all. When I assign something to `Foo.whatever` after the class has been defined the method *is* called.

What's the reason for this behaviour and is there a way to intercept the assignments that happen during the creation of the class? Using `attrs` in `__new__` won't work since I'd like to [check if a method is being redefined](https://stackoverflow.com/q/10761988/298479).