[issue25609] Add a ContextManager ABC and type

Guido van Rossum report at bugs.python.org
Sun Jan 3 16:28:19 EST 2016


Guido van Rossum added the comment:

The abstract base class would be an ABC providing documentation and a template for implementations, and a way to test using isinstance(). This is how several other ABCs are used that have no particularly useful default implementation.

In addition, the presence of the ABC provides a reference for corresponding class in the typing module (used to express type hints using PEP 484) -- again this is just following the example of the other ABCs.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25609>
_______________________________________


More information about the Python-bugs-list mailing list