Mel wrote: ... >Here's something that works, in the sense of creating a tuple >containing a self-reference. I don't know how dangerous it realliy is ...
Thanks for the testing. Given the unknown dangers that might (or might not) lurk with these things, the fact that recursive tuples are never going to be needed in practice and because using a c-extension only to support near-nonsense, I've made up my mind to simply disallow recursive immutables. It will force me to write some complex loading code in order to mix and match recursive/non-recursive, but at least it will work in ~100% of all use cases, black magic not required. My general approach will be: Create empty versions of all referenced mutables. Top-sort immutables, create them in the correct order of dependency, filling them with previously created immutables and empty mutables. Fill up all the mutables with actual content. This should allow anything except two immutables mutually depending on eachother. ---------------------------------------------------------------- Brought to you by Footard: http://www.footard.com Please report abuse/spam/scams to reportabuse at footard dot com -- http://mail.python.org/mailman/listinfo/python-list