Skip to content

Commit

Permalink
Fix example code formatting for CachingFileManager (#9178)
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese authored Jun 26, 2024
1 parent 07b1756 commit 19d0fbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xarray/backends/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ class CachingFileManager(FileManager):
FileManager.close(), which ensures that closed files are removed from the
cache as well.
Example usage:
Example usage::
manager = FileManager(open, 'example.txt', mode='w')
f = manager.acquire()
f.write(...)
manager.close() # ensures file is closed
Note that as long as previous files are still cached, acquiring a file
multiple times from the same FileManager is essentially free:
multiple times from the same FileManager is essentially free::
f1 = manager.acquire()
f2 = manager.acquire()
Expand Down

0 comments on commit 19d0fbf

Please sign in to comment.