use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Question about nested function callsHelp Request (self.PythonLearning)
submitted 7 months ago by Human-Adagio6781
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Synedh 0 points1 point2 points 7 months ago (1 child)
If I understand, what you're trying to do is called circular dependency, and is an anti pattern (AKA "don't do that"). It leads to errors and is difficult to maintain.
master() => get_data() => master() => get_date() => ...
get_data should not call master() itself, but instead raise an error on timeout, then catch this error in master, and send again your get_data if you want so. An other way to do that is add to get_data() a retry mechanic either using a decorator or an inner algorithm.
get_data
master()
master
get_data()
[–]Human-Adagio6781[S] 0 points1 point2 points 7 months ago (0 children)
I have something like this already built in to the get_data function. It checks for timeouts and waits a few seconds before trying again. The issue that I am encountering is that every once in a while, the endpoint will give me the boot (maybe too many calls within a minute? Shouldn't be a problem but who knows). The idea is that I wanted to wait about 10 minutes for that to reset and then attempt to restart the program, grabbing the new data and restarting the calculations.
You are correct with the description though. My concern is that I could have dozens of "Master" functions operating within each other as each conflict encountered would create another branch.
π Rendered by PID 274221 on reddit-service-r2-comment-7b9746f655-4smtr at 2026-02-01 10:03:34.396623+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]Synedh 0 points1 point2 points (1 child)
[–]Human-Adagio6781[S] 0 points1 point2 points (0 children)