-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Description
Our path type is derived from pathlib.Path with additional format operators, and like Path, we will have to use expanduser() to expand ~:
>>> path(os.path.expanduser('~/.bashrc')).exists()
True
>>> path('~/.bashrc').exists()
False
>>> path('~/.bashrc').expanduser().exists()
True
Since path is a SoS type and SoS automatically expand ~, I believe we should treat
path('~/.bashrc').exists()
as
path('~/.bashrc').expanduser().exists()
The problem is that we will have to redefine many functions such as exists, is_dir, is_file, ..., and it does not look right if we automatically change the string representation of input path
>>> str(path('~/.bashrc').expanduser())
'/Users/bpeng1/.bashrc'
>>> str(path('~/.bashrc'))
'~/.bashrc'
Metadata
Metadata
Assignees
Labels
No labels