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

Method __init__

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

Source from the content-addressed store, hash-verified

277 raise Error('fmt chunk and/or data chunk missing')
278
279 def __init__(self, f):
280 self._i_opened_the_file = None
281 if isinstance(f, str):
282 f = builtins.open(f, 'rb')
283 self._i_opened_the_file = f
284 # else, assume it is an open file object already
285 try:
286 self.initfp(f)
287 except:
288 if self._i_opened_the_file:
289 f.close()
290 raise
291
292 def __del__(self):
293 self.close()

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