shlogg · Early preview
Nomi3 @nomi3

Overriding Decorator Arguments In Child Classes

To override decorator args in a child class, you need to redefine the method. Declaring new class variables won't affect the decorator unless you explicitly redefine the method.

To override the decorator arguments used in a parent class method within a child class, you need to override the method in the child class. Simply declaring new class variables with the same names will not affect the decorator arguments unless you explicitly redefine the method.

  
  
  Sample Code

Save the following as test.py

def my_decorator_with_args(param1, param2):
    """Decorator that takes arguments"""
    def actual_decorator(func):
        def wrapper(self, *args, **kwargs):
            print(f"[Decorator] param1={param1}, param2={param2}")
            return func(self, *args, **...