suggestions

Added in version 3.2.0.

This module contains the helper functions needed to make suggestions when errors occur.

Functions

suggest_symbol(word, options)[source]

Select the best match for word from a list of value options. Values that are not suitable symbol names will be filtered out of options. If no match is found, this function will return None.

Parameters:
  • word (str) – The original word to suggest an alternative for.

  • options (tuple) – A list of strings to select the best match from.

Returns:

The best replacement for word.

Return type:

str