A decorator in Python is a design pattern used to add new functionality to an object without altering its ____.

  • attributes
  • class
  • methods
  • structure
In Python, decorators are typically used to add new functionality to methods of a class without changing the method's name or signature. This is commonly used for tasks like logging, authorization, and caching.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *