Understanding decorators that work as wrappers