MCPcopy Index your code
hub / github.com/python/cpython / __enter__

Method __enter__

Lib/_pyio.py:479–482  ·  view source on GitHub ↗

Context management protocol. Returns self (an instance of IOBase).

(self)

Source from the content-addressed store, hash-verified

477 ### Context manager ###
478
479 def __enter__(self): # That's a forward reference
480 """Context management protocol. Returns self (an instance of IOBase)."""
481 self._checkClosed()
482 return self
483
484 def __exit__(self, *args):
485 """Context management protocol. Calls close()"""

Callers

nothing calls this directly

Calls 1

_checkClosedMethod · 0.95

Tested by

no test coverage detected