From 9c75bca71a6d428a84db7c77ffe055d75a266280 Mon Sep 17 00:00:00 2001 From: Prashastha Mudannayake <37573569+prashastham@users.noreply.github.com> Date: Sat, 31 Aug 2024 20:13:31 +0530 Subject: [PATCH] Fix issue in decorator class exmaple in decorators.rst Seems like passing variable arguments and key word arguments to the __init__() of the super class is incorrect --- decorators.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/decorators.rst b/decorators.rst index 30509fe..413482b 100644 --- a/decorators.rst +++ b/decorators.rst @@ -440,9 +440,9 @@ will not be covered here). A logit implementation for sending emails to admins when the function is called. ''' - def __init__(self, email='admin@myproject.com', *args, **kwargs): + def __init__(self, func, email='admin@myproject.com'): self.email = email - super(email_logit, self).__init__(*args, **kwargs) + super(email_logit, self).__init__(func) def notify(self): # Send an email to self.email