def build_env_list(obj: Settings | LazySettings, env: str | None) -> list[str]:
    """Build env list for loaders to iterate.

    Arguments:
        obj {LazySettings} -- A Dynaconf settings instance
        env {str} -- The current env to be loaded

    Returns:
        [str] -- A list of string names of the envs to load.
    """
    # add the [default] env
    env_list = [(obj.get("DEFAULT_ENV_FOR_DYNACONF") or "default").lower()]

    # compatibility with older versions that still uses [dynaconf] as
    # [default] env
    global_env = (obj.get("ENVVAR_PREFIX_FOR_DYNACONF") or "dynaconf").lower()
    if global_env not in env_list:
        env_list.append(global_env)

    # add the current env counting on the case where it is a comma separated list
    current_env = obj.current_env
    if current_env and isinstance(current_env, str):
        for item in current_env.split(","):
            if item and (_name := item.strip().lower()) not in env_list:
                env_list.append(_name)

    # add a manually set env counting on the case where it is a comma separated list
    if env and isinstance(env, str):
        for item in env.split(","):
            if item and (_name := item.strip().lower()) not in env_list:
                env_list.append(_name)

    # add the [global] env
    env_list.append("global")

    return env_list
Build env list for loaders to iterate.

    Arguments:
        obj {LazySettings} -- A Dynaconf settings instance
        env {str} -- The current env to be loaded

    Returns:
        [str] -- A list of string names of the envs to load.
    
dynaconf/utils/__init__.py