A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
feat: PathState follows os.PathLike ABC (#8403)
Andrew Glick0c5ed8216202
diff --git a/marimo/_runtime/watch/__init__.py b/marimo/_runtime/watch/__init__.pyindex d52377b8f4..c000ee018e 100644--- a/marimo/_runtime/watch/__init__.py+++ b/marimo/_runtime/watch/__init__.py@@ -1,7 +1,8 @@# Copyright 2026 Marimo. All rights reserved.-from marimo._runtime.watch._directory import directory-from marimo._runtime.watch._file import file+from marimo._runtime.watch._directory import DirectoryState, directory+from marimo._runtime.watch._file import FileState, file+from marimo._runtime.watch._path import PathState# NB. _runtime/reload captures module level changes and# marimo/_server/sessions.py captures notebook level changes.@@ -9,4 +10,7 @@ from marimo._runtime.watch._file import file__all__ = ["file","directory",+ "FileState",+ "DirectoryState",+ "PathState",]diff --git a/marimo/_runtime/watch/_path.py b/marimo/_runtime/watch/_path.pyindex a16bd067f4..7dd5ad5580 100644--- a/marimo/_runtime/watch/_path.py+++ b/marimo/_runtime/watch/_path.py@@ -111,6 +111,12 @@ class PathState(State[Path]):def __repr__(self) -> str:return f"{self.__class__.__name__}({self._value})"+ def __fspath__(self) -> str:+ return self._value.__fspath__()++ def __str__(self) -> str:+ return str(self._value)+def exists(self) -> bool:"""Check if the path exists."""exists = self._value.exists()diff --git a/tests/snapshots/api.txt b/tests/snapshots/api.txtindex c4f76e80e6..f77a695603 100644--- a/tests/snapshots/api.txt+++ b/tests/snapshots/api.txt@@ -124,5 +124,8 @@ uivideovstackwatch+ DirectoryState+ FileState+ PathStatedirectoryfile\ No newline at end of file