[New-bugs-announce] [issue44471] Raise TypeError in ExitStack.enter_context() for bad argument

Serhiy Storchaka report at bugs.python.org
Mon Jun 21 03:43:53 EDT 2021


New submission from Serhiy Storchaka <storchaka+cpython at 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 <report at bugs.python.org>
<https://bugs.python.org/issue44471>
_______________________________________


More information about the New-bugs-announce mailing list