def _setting_list(self, var: str, key: str) -> list[str]:
        """
        Get a list value, either comma separated or structured.

        Returns `None` if both the environment variable and the key does not exists.
        """
        if value := self.project.env_or_setting(var, key):
            if isinstance(value, str):
                value = [stripped for v in value.split(",") if (stripped := v.strip())]
            return [stripped for v in value if (stripped := v.strip())]
        return []

        Get a list value, either comma separated or structured.

        Returns `None` if both the environment variable and the key does not exists.
        
src/pdm/environments/base.py