I'm trying to get something like the following pseudocode to work:
class AppConfig:
root: str = environ.var(default="/data/", converter=str)
folder: str = AppConfig.root + "subfolder/"
cfg = environ.to_config(AppConfig)
The expected behaviour being that I can type cfg.folder and get the string "/data/subfolder/" back. Basically, I want to be able to set values on the cfg object on the basis of other values that are populated by environment variables. I use this pattern all the time in my code - it's especially useful when you want to set a root folder using an environment variable and then specify a bunch of subfolders relative to that root.
Is there any way of accomplishing this?