MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / expanduser

Method expanduser

tools/python-3.11.9-amd64/Lib/pathlib.py:1377–1388  ·  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

1375 return False
1376
1377 def expanduser(self):
1378 """ Return a new path with expanded ~ and ~user constructs
1379 (as returned by os.path.expanduser)
1380 """
1381 if (not (self._drv or self._root) and
1382 self._parts and self._parts[0][:1] == '~'):
1383 homedir = os.path.expanduser(self._parts[0])
1384 if homedir[:1] == "~":
1385 raise RuntimeError("Could not determine home directory.")
1386 return self._from_parts([homedir] + self._parts[1:])
1387
1388 return self
1389
1390
1391class PosixPath(Path, PurePosixPath):

Callers 15

joinuserFunction · 0.80
register_readlineFunction · 0.80
homeMethod · 0.80
joinuserFunction · 0.80
_expand_varsFunction · 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

Calls 1

_from_partsMethod · 0.80

Tested by

no test coverage detected