Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/upath/__init__.py: 52%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""Pathlib API extended to use fsspec backends."""
3from __future__ import annotations
5from typing import TYPE_CHECKING
7try:
8 from upath._version import __version__
9except ImportError:
10 __version__ = "not-installed"
12if TYPE_CHECKING:
13 from upath.core import UnsupportedOperation
14 from upath.core import UPath
16__all__ = ["UPath", "UnsupportedOperation"]
19def __getattr__(name):
20 if name == "UPath":
21 from upath.core import UPath
23 globals()["UPath"] = UPath
24 return UPath
25 elif name == "UnsupportedOperation":
26 from upath.core import UnsupportedOperation
28 globals()["UnsupportedOperation"] = UnsupportedOperation
29 return UnsupportedOperation
30 else:
31 raise AttributeError(f"module {__name__} has no attribute {name}")