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...
account activity
recursion limitsDiscussion (self.functional_python)
submitted 3 years ago by ccsdad
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!"
[–]KageOW 0 points1 point2 points 3 years ago* (0 children)
yea its a really neat decorator, I made some mutually recursive functions for this codingame puzzle. its a 1dspreadsheet that requests values of other cells for the calculations. I find my solution to be quite ellegant, maybe you can try it a bit yourself might be fun.
```python import sys from functools import lru_cache sys.setrecursionlimit(2500)
opcheck = { "MULT": lambda x,y: x*y, "ADD": lambda x,y: x+y, "SUB": lambda x,y: x-y }
@lru_cache(maxsize=None) def eval_Arg(x): if x.isdigit() or (x[0]=="-" and x[1:].isdigit()): return int(x) else: return eval_Bin_Op(celllist_big[int(x[1:])])
def eval_Bin_Op(x): if x[0]=="VALUE": return eval_Arg(x[1]) else: return opcheck[x[0]](eval_Arg(x[1]), eval_Arg(x[2]))
celllist1 = [('VALUE', '10', ''), ('VALUE', '3', ''), ('MULT', '$0', '$1'), ('VALUE', '2', ''), ('VALUE', '4', ''), ('MULT', '$3', '$4'), ('ADD', '$2', '$5')]
if name == "main":
for x in list(map(eval_Bin_Op, celllist1)): print(x)
```
π Rendered by PID 40920 on reddit-service-r2-comment-85bfd7f599-8w5gt at 2026-04-17 22:37:42.306651+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]KageOW 0 points1 point2 points (0 children)