If a function that tends to return a context manager returns None, that should not mean an error occurred. If an error or unexpected condition occurred, an exception should be thrown. Errors and exceptions should result in the code within the with statement not executing.
We could add a new constant to Python, “Dont.” It’s a global falsey Singleton and a context manager that causes the code inside “with” not to execute. > On May 18, 2019, at 10:44 PM, Yonatan Zunger <zun...@humu.com> wrote: > > an _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/VJ2ZRJKPNUWQZ3UHJN26X236E5REVUXW/ Code of Conduct: http://python.org/psf/codeofconduct/