how to use function attributes in python