You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(disk): add dir_exists() as the directory-only sibling of file_exists()
`file_exists()` wraps `os.path.isfile()` and therefore returns False for
directories, which is easy to miss when reading a caller. The new
`dir_exists()` makes the intent explicit and avoids the trap of
silently never matching directory paths. The docstring on `file_exists`
now also calls out the file-only behavior and points readers at
`dir_exists`.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
9
9
## [Unreleased]
10
10
11
-
tbd
11
+
### Added
12
+
13
+
* disk.py: add `dir_exists()` as the directory-only counterpart to `file_exists()`. The existing `file_exists()` wraps `os.path.isfile()` and therefore returns `False` for directories, which is easy to miss; callers that want to check for a directory should now use `dir_exists()`
0 commit comments