On 1/3/2018 11:16 AM, Guido van Rossum wrote:
Maybe I should clarify again what run() does. Here's how I think of it in pseudo code:

def run(self, func, *args, **kwds):
    old = _get_current_context()
    new = old.copy()
    _set_current_context(new)
    try:
        return func(*args, **kwds)
    finally:
        _set_current_context(old)

</lurking>

I find it interesting that self isn't used in the above pseudo-code. I thought that Context.run() would run the function in the "context" of self, not in the context of a copy of "current context".

</lurking>
_______________________________________________
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

Reply via email to