Skip to content

Instantly share code, notes, and snippets.

@elyssonmr
Created December 27, 2019 19:38
Show Gist options
  • Save elyssonmr/64d438469eb64415cb9019f328bd963a to your computer and use it in GitHub Desktop.
Save elyssonmr/64d438469eb64415cb9019f328bd963a to your computer and use it in GitHub Desktop.
VARIABLE_CACHE = {}
def request_data(url):
if 'my_data' not in VARIABLE_CACHE:
data = request_data_from_web(url)
VARIABLE_CACHE['my_data'] = data
return data
else:
return VARIABLE_CACHE['my-data']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment