Close the file stream associated with this corpus view. This can be useful if you are worried about running out of file handles (although the stream should automatically be closed upon garbage collection of the corpus view). If the corpus view is accessed a
(self)
| 215 | self._stream = open(self._fileid, "rb") |
| 216 | |
| 217 | def close(self): |
| 218 | """ |
| 219 | Close the file stream associated with this corpus view. This |
| 220 | can be useful if you are worried about running out of file |
| 221 | handles (although the stream should automatically be closed |
| 222 | upon garbage collection of the corpus view). If the corpus |
| 223 | view is accessed after it is closed, it will be automatically |
| 224 | re-opened. |
| 225 | """ |
| 226 | if self._stream is not None: |
| 227 | self._stream.close() |
| 228 | self._stream = None |
| 229 | |
| 230 | def __enter__(self): |
| 231 | return self |
no outgoing calls
no test coverage detected