This is a development version (9.14.0.dev) and may be unstable. Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.14.0.dev / IPython / core / completer / expand_user

function

IPython.core.completer:expand_user

source: /IPython/core/completer.py :371

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 : str

String to be expanded. If no ~ is present, the output is the same as the input.

Returns

newpath : str

Result of ~ expansion in the input path.

tilde_expand : bool

Whether any expansion was performed or not.

tilde_val : str

The value that ~ was replaced with.

Aliases

  • IPython.core.completer.expand_user