MCPcopy Index your code
hub / github.com/RustPython/RustPython / expanduser

Method expanduser

Lib/pathlib/__init__.py:1241–1253  ·  view source on GitHub ↗

Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser)

(self)

Source from the content-addressed store, hash-verified

1239 raise UnsupportedOperation(f"{f} is unsupported on this system")
1240
1241 def expanduser(self):
1242 """ Return a new path with expanded ~ and ~user constructs
1243 (as returned by os.path.expanduser)
1244 """
1245 if (not (self.drive or self.root) and
1246 self._tail and self._tail[0][:1] == '~'):
1247 homedir = os.path.expanduser(self._tail[0])
1248 if homedir[:1] == "~":
1249 raise RuntimeError("Could not determine home directory.")
1250 drv, root, tail = self._parse_path(homedir)
1251 return self._from_parsed_parts(drv, root, tail + self._tail[1:])
1252
1253 return self
1254
1255 @classmethod
1256 def home(cls):

Callers 15

joinuserFunction · 0.80
gethistoryfileFunction · 0.80
__init__Method · 0.80
_candidate_tempdir_listFunction · 0.80
__init__Method · 0.80
parse_ignore_dirFunction · 0.80
__init__Method · 0.80
goMethod · 0.80
get_filterMethod · 0.80
get_selectionMethod · 0.80
joinuserFunction · 0.80
_expand_varsFunction · 0.80

Calls 2

_parse_pathMethod · 0.80
_from_parsed_partsMethod · 0.80

Tested by 10

test_expanduserMethod · 0.64
test_expanduser_pwdMethod · 0.64
test_expanduser_pwd2Method · 0.64
_test_homeMethod · 0.64
test_with_segmentsMethod · 0.64
test_expanduser_posixMethod · 0.64
checkMethod · 0.64