bundles / IPython 9.5.0 / IPython / core / completer / expand_user
function
IPython.core.completer:expand_user
source: /IPython/core/completer.py :373
Signature
def expand_user ( path : str ) → tuple[str, bool, str] Summary
Expand ~-style usernames in strings.
Extended Summary
This is similar to os.path.expanduser, but it computes and returns extra information that will be useful if the input was being used in computing completions, and you wish to return the completions with the original '~' instead of its expanded value.
Parameters
path: strString to be expanded. If no ~ is present, the output is the same as the input.
Returns
newpath: strResult of ~ expansion in the input path.
tilde_expand: boolWhether any expansion was performed or not.
tilde_val: strThe value that ~ was replaced with.
Aliases
-
IPython.core.completer.expand_user