Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/python/cpython
/ close
Method
close
Lib/test/test_contextlib.py:411–412 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
409
state = []
410
class
C:
411
def
close(self):
412
state.append(1)
413
x = C()
414
self.assertEqual(state, [])
415
with
closing(x)
as
y:
Callers
2
test_close
Method · 0.45
test_pop_all
Method · 0.45
Calls
1
append
Method · 0.45
Tested by
no test coverage detected