MCPcopy
hub / github.com/cool-RR/PySnooper / expanduser

Method expanduser

tests/mini_toolbox/pathlib.py:1650–1659  ·  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

1648 return False
1649
1650 def expanduser(self):
1651 """ Return a new path with expanded ~ and ~user constructs
1652 (as returned by os.path.expanduser)
1653 """
1654 if (not (self._drv or self._root)
1655 and self._parts and self._parts[0][:1] == '~'):
1656 homedir = self._flavour.gethomedir(self._parts[0][1:])
1657 return self._from_parts([homedir] + self._parts[1:])
1658
1659 return self
1660
1661
1662class PosixPath(Path, PurePosixPath):

Callers

nothing calls this directly

Calls 2

_from_partsMethod · 0.80
gethomedirMethod · 0.45

Tested by

no test coverage detected