I've written the following base static class in python:
from abc import ABC,abstractmethod
import typing
from main_module import utils
class BaseCLS(ABC):
credentials = None # <--- I want to set this var
def __init_session(caller) -> None:
credentials = utils.get_creds() # <--- not the right var
@staticmethod
@__init_session
def process(path: str) -> None:
raise NotImplementedError
The base class private method __init_session
is triggered by a decorator each time process
is called. I'm trying to set the credentials
class var from within the private method with no luck. How can I achieve my goal?