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

Class CustomOpenHook

Lib/test/test_fileinput.py:269–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267 pass
268
269 class CustomOpenHook:
270 def __init__(self):
271 self.invoked = False
272 def __call__(self, *args, **kargs):
273 self.invoked = True
274 return open(*args, encoding="utf-8")
275
276 t = self.writeTmp("\n")
277 custom_open_hook = CustomOpenHook()

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…