Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/upath/_info.py: 61%

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

18 statements  

1from __future__ import annotations 

2 

3from typing import TYPE_CHECKING 

4 

5from upath.types import PathInfo 

6 

7if TYPE_CHECKING: 

8 from upath import UPath 

9 

10 

11__all__ = [ 

12 "UPathInfo", 

13] 

14 

15 

16class UPathInfo(PathInfo): 

17 """Path info for UPath objects.""" 

18 

19 def __init__(self, path: UPath) -> None: 

20 self._path = path.path 

21 self._fs = path.fs 

22 

23 def exists(self, *, follow_symlinks=True) -> bool: 

24 return self._fs.exists(self._path) 

25 

26 def is_dir(self, *, follow_symlinks=True) -> bool: 

27 return self._fs.isdir(self._path) 

28 

29 def is_file(self, *, follow_symlinks=True) -> bool: 

30 return self._fs.isfile(self._path) 

31 

32 def is_symlink(self) -> bool: 

33 return False