3 ms·
def x(input): tmp=input * 5 return str(tmp) hey, hidden state!
by hprotagonist 5y ago
def x(input):
tmp=input * 5
return str(tmp)
hey, hidden state!
- sullyj3 5y agoIf that were Haskell instead of python, it would still work, because tmp is never mutated. So it's not really state in that sense, it's just a binding. x input = show tmp where tmp = input * 5 It would be a different story if you had something like class IntState: def __init__(self, val): self.val = val def x(input): self.val += input return str(val)