New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:
For consistency with the "with" statement (see issue12022) ExitStack.enter_context() should raise TypeError instead of AttributeError if the argument is not a context manager. Same for AsyncExitStack.enter_async_context(). ---------- components: Library (Lib) messages: 396209 nosy: ncoghlan, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Raise TypeError in ExitStack.enter_context() for bad argument type: enhancement versions: Python 3.11 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44471> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com