Created
December 27, 2019 19:38
-
-
Save elyssonmr/64d438469eb64415cb9019f328bd963a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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