MCPcopy Index your code
hub / github.com/RustPython/RustPython / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

444 _file = None
445
446 def __init__(self, f):
447 self._i_opened_the_file = None
448 if isinstance(f, str):
449 f = builtins.open(f, 'wb')
450 self._i_opened_the_file = f
451 try:
452 self.initfp(f)
453 except:
454 if self._i_opened_the_file:
455 f.close()
456 raise
457
458 def initfp(self, file):
459 self._file = file

Callers

nothing calls this directly

Calls 4

initfpMethod · 0.95
isinstanceFunction · 0.85
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected