This function only closes the file if it was opened by the lazy file wrapper. For instance this will never close stdin.
(self)
| 182 | self._f.close() |
| 183 | |
| 184 | def close_intelligently(self) -> None: |
| 185 | """This function only closes the file if it was opened by the lazy |
| 186 | file wrapper. For instance this will never close stdin. |
| 187 | """ |
| 188 | if self.should_close: |
| 189 | self.close() |
| 190 | |
| 191 | def __enter__(self) -> LazyFile: |
| 192 | return self |