13 ms·
Could use a class, but access the value without ever instantiating it? Not sure if this fits the bill for what you want, or if the fact that it could theoretica
by mitchellpkt 3y ago
Could use a class, but access the value without ever instantiating it? Not sure if this fits the bill for what you want, or if the fact that it could theoretically be instantiated renders the approach non-suitable.
class Config:
root_directory: str = "/tmp"
should_frobnicate: bool = False
if __name__=="__main__":
print(f"{Config.root_directory=}\n{Config.should_frobnicate=}")