Greg Ewing wrote: > Nick Coghlan wrote: > >> By 'current namespace' I really do mean locals() - the cell objects >> themselves >> would be local variables from the point of view of the currently >> executing code. > > This is wrong. Cells are *parameters* implicitly passed > in by the calling function. They may temporarily be > referenced from the current scope, but their "home" > has to be in an outer scope, otherwise they won't > survive between calls.
As far as I'm aware, the cell objects get kept alive by the references to them from the closure attribute of the inner function. The actual execution frame of the outer function still goes away. The cell values persist because the function object persists between calls - it's only the execution frame that gets reinitialised every time. However, I'm now clearer on the fact that Guido's main interest is in true once-per-process semantics for case expressions, which changes the design goals I was working towards. So I think I'll try to take a break from this discussion, and let ideas percolate in the back of my head for a while :) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com