MCPcopy Create free account
hub / github.com/numpy/numpy / close

Method close

numpy/lib/npyio.py:212–223  ·  view source on GitHub ↗

Close the file.

(self)

Source from the content-addressed store, hash-verified

210 self.close()
211
212 def close(self):
213 """
214 Close the file.
215
216 """
217 if self.zip is not None:
218 self.zip.close()
219 self.zip = None
220 if self.fid is not None:
221 self.fid.close()
222 self.fid = None
223 self.f = None # break reference cycle
224
225 def __del__(self):
226 self.close()

Callers 15

__exit__Method · 0.95
__del__Method · 0.95
check_doctestsFunction · 0.45
check_doctests_testfileFunction · 0.45
write_textMethod · 0.45
write_htmlMethod · 0.45
write_textMethod · 0.45
write_htmlMethod · 0.45
find_functionsFunction · 0.45
test_dtype_copyMethod · 0.45

Calls

no outgoing calls

Tested by 15

test_dtype_copyMethod · 0.36
add_closeFunction · 0.36
test_close_raisesFunction · 0.36
teardown_methodMethod · 0.36
test_largish_fileMethod · 0.36
test_mmap_closeMethod · 0.36
mainFunction · 0.36
test_py3_compatMethod · 0.36