In my project I have a settings.py which contains a class and a constructor. (It contains more than 70 instance variables.)
I know I can call that variable with the help of by creating class object.value, but I have more than 25 folders. Is calling with help of a class name the best approach? Will it slow performance?
My directory structure:.
├───A
│ ├───.idea
│ │ └───inspectionProfiles
│ ├───abrest
│ │ └───app
│ │ ├───config
│ │ │ └───settings.py
└───log_config.py
│ │ ├───handle
│ │ └───utils
│ ├───utils
│ └───test.py
a) setting.py
class BaseConfig:
def __init__(self):
self.A = '/api'
self.B = False
self.C = False
self.D = "0.0.0.0"
self.E = "localhost"
self.F = 8000
self.G = "test"
self.H = 'tokens'
self.I = 'default-secret'
b) How can I call inside other directory without doing class name (because I believe it is not the best practice if there are more than 100 variables).
For example, I am calling variable in:
test.py
from abrest.app.config.settings import BaseConfig
print(BaseConfig().B)
Output:
PycharmProjects/A/utils/test.py False Is there any way to call it from config.variable_name OR config.log_config_variable? (And also I need suggestions on how it will affect performance.)