Question #907

A decorator can be decorated with itself.

A decorator cannot be decorated with itself. Something like:


@my_decorator
def my_decorator(a_function):
    print("This is decorated")
    return a_function

will throw a NameError exception. (realpython.com/primer-on-python-decorators)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵