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

Method __init__

Lib/wave.py:456–466  ·  view source on GitHub ↗
(self, f)

Source from the content-addressed store, hash-verified

454 _file = None
455
456 def __init__(self, f):
457 self._i_opened_the_file = None
458 if isinstance(f, (bytes, str, os.PathLike)):
459 f = builtins.open(f, 'wb')
460 self._i_opened_the_file = f
461 try:
462 self.initfp(f)
463 except:
464 if self._i_opened_the_file:
465 f.close()
466 raise
467
468 def initfp(self, file):
469 self._file = file

Callers

nothing calls this directly

Calls 3

initfpMethod · 0.95
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected