1 required positional argument: 'self'
                  
                  
                  
                  
                  
                  I think I am missing some understanding in Python.
                  
                  
                  
                  
                  
                  I am calling it like this from another class:
                  
                  
                  
                  
                  
                  mandrill_client = MandrillMailer.get_client()
                  
                  
                  
                  
                  
                  MandrillMailer:
                  
                  
                  
                  
                  
                  @dataclass
                  
                  
                  class MandrillMailer:
                  
                  
                      logger: Logger
                  
                  
                      config_parser: ConfigParser
                  
                  
                  
                  
                  
                      def get_client(self):
                  
                  
                  
                  
                  
                  something to do with the @dataclass?
                  
                  
                
Learn about static methods and how to implement them in python
MandrillMailer is a class get_client is an instance method You first instance a MandrillMailer object and then call get_client on that. Or you define a class method, not an instance method Still better, get a basic tutorial on OOP
I worked it out, this article helped
Обсуждают сегодня