> I haven't totally grokked what is going on in the hash_update and
> __jug_hash__ functions, but it seems like something like this might work.
hash_update adds Python objects to a hash object. Basically, hashes are
computed like:
h = create_hash()
hash_update(h, ...)
hash_update(h, ...)
hash_update(h, ...)
hash_update(h, ...)
finalize(h)
__jug_hash__() builds the hash for a Task (or any other object which
defines it).
>
http://neopythonic.blogspot.com/2009/04/final-words-on-tail-calls.html
>
> Or perhaps you could do a DFS using an explicit stack rather than the
> call
> stack on the object to find all jug dependencies, and then compute the
> hashes from the bottom up? I'm not exactly sure how the back and forth
> works between hash_update and __jug_hash__ to see if this could easily be
> moved into one function.
In general, it'd be quite hard. hash_update can be done better,
flattening the stack a bit. This makes it harder to trigger the issue
(by a factor of 1 or 2).
But the whole thing is very intertwined and the fact that the user can
add __jug_hash__ to any object (which I am sure is a rarely used
feature, but is there, and I have used it) makes the whole thing a bit
tricky.
Task.__jug_hash__ also only computes the hash the first time it is
called, which is important for speed.
*
The simplest solution is likely to just call
`sys.setrecursionlimit(100000)`
or use explicit hash triggers.
Cheers,
Luis
> > > email to
jug-users+...@googlegroups.com <javascript:>.