Skip to content

Commit

Permalink
Deprecate content method
Browse files Browse the repository at this point in the history
  • Loading branch information
p1c2u committed Oct 13, 2023
1 parent 4ad93d1 commit 3c2c377
Show file tree
Hide file tree
Showing 2 changed files with 436 additions and 307 deletions.
6 changes: 5 additions & 1 deletion pathable/paths.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pathable paths module"""
import warnings
from contextlib import contextmanager
from typing import Any
from typing import Hashable
Expand Down Expand Up @@ -209,7 +210,10 @@ def items(self: TAccessorPath) -> Iterator[Tuple[Any, TAccessorPath]]:
yield key, self._make_child_relpath(key)

def content(self) -> Any:
"""Return content of the path."""
warnings.warn(
"content parameter is deprecated.",
DeprecationWarning,
)
with self.open() as d:
return d

Expand Down
Loading

0 comments on commit 3c2c377

Please sign in to comment.