On Sun, May 26, 2019 at 8:38 AM Richard Damon <rich...@damon-family.org> wrote: > > On 5/25/19 5:09 PM, Nathaniel Smith wrote: > > a = locals() > > b = locals() > > # now our first "snapshot" has changed > > assert "a" in a > > > To me that is a static snapshot of a dynamic environment, not a dynamic > snapshot. The snapshot you get at THAT moment in time won't change, as > time progresses, so that snapshot itself isn't dynamic.
Except that it does. After calling locals() a second time, the result of the *first* call will be updated to reflect changes. It's not a frozen snapshot; you can't diff the two dictionaries to see what's changed (unless you use "a = dict(locals())" or something, which IS a snapshot). >From my reading of the description, you could also "assert a is b" - is that correct? ChrisA _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com