Skip to content

Commit

Permalink
Typing and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclary committed Dec 17, 2024
1 parent 608668f commit b9c2b90
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions spyder/utils/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,20 @@ def listdict2envdict(listdict):
return listdict


def get_user_environment_variables(clear_cache=False):
def get_user_environment_variables(clear_cache: bool = False) -> dict:
"""
Get cached user environment variables.
Parameters
----------
clear_cache : bool (False)
Get user environment variables after resetting the cache.
Returns
-------
env_var : dict
Key-value pairs of environment variables.
"""
if clear_cache:
_get_user_environment_variables.cache_clear()

Expand All @@ -96,9 +109,9 @@ def get_user_environment_variables(clear_cache=False):


@lru_cache
def _get_user_environment_variables():
def _get_user_environment_variables() -> dict:
"""
Get user environment variables from a subprocess.
Get user environment variables from a subprocess and cache the result.
Returns
-------
Expand Down

0 comments on commit b9c2b90

Please sign in to comment.