Yury Selivanov wrote:
I still think that giving Python programmers one strong rule: "context mutation is always isolated in generators" makes it easier to reason about the EC and write maintainable code.
Whereas I think it makes code *harder* to reason about, because to take advantage of it you need to be acutely aware of whether the code you're working on is in a generator/coroutine or not. It seems simpler to me to have one rule for all kinds of functions: If you're making a temporary change to contextual state, always encapsulate it in a with statement. -- Greg _______________________________________________ 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