# eric4.QScintilla.TypingCompleters.CompleterPython

Module implementing a typing completer for Python.

### Global Attributes

None

### Classes

CompleterPython | Class implementing typing completer for Python.

### Functions

None

## CompleterPython

Class implementing typing completer for Python.

### Derived from

CompleterBase

### Class Attributes

None

### Class Methods

None

### Methods

CompleterPython | Constructor
__dedentDefStatement | Private method to dedent the line of the def statement to a previous def statement or class statement.
__dedentElseToIfWhileForTry | Private method to dedent the line of the else statement to the last if, while, for or try statement with less (or equal) indentation.
__dedentExceptToTry | Private method to dedent the line of the except statement to the last try statement with less (or equal) indentation.
__dedentFinallyToTry | Private method to dedent the line of the except statement to the last try statement with less (or equal) indentation.
__dedentToIf | Private method to dedent the last line to the last if statement with less (or equal) indentation.
__inComment | Private method to check, if the cursor is inside a comment
__inDoubleQuotedString | Private method to check, if the cursor is within a double quoted string.
__inSingleQuotedString | Private method to check, if the cursor is within a single quoted string.
__inTripleDoubleQuotedString | Private method to check, if the cursor is within a triple double quoted string.
__inTripleSingleQuotedString | Private method to check, if the cursor is within a triple single quoted string.
__isClassMethod | Private method to check, if the user is defining a class method.
__isClassmethodDef | Private method to check, if the user is defing a classmethod (@classmethod) method.
charAdded | Public slot called to handle the user entering a character.
readSettings | Public slot called to reread the configuration parameters.

### Static Methods

None

#### CompleterPython (Constructor)

CompleterPython(editor, parent = None)

Constructor

editor
  reference to the editor object (QScintilla.Editor)
parent
  reference to the parent object (QObject)

#### CompleterPython.__dedentDefStatement

__dedentDefStatement()

Private method to dedent the line of the def statement to a previous def statement or class statement.

#### CompleterPython.__dedentElseToIfWhileForTry

__dedentElseToIfWhileForTry()

Private method to dedent the line of the else statement to the last if, while, for or try statement with less (or equal) indentation.

#### CompleterPython.__dedentExceptToTry

__dedentExceptToTry(hasColon)

Private method to dedent the line of the except statement to the last try statement with less (or equal) indentation.

hasColon
  flag indicating the except type (boolean)

#### CompleterPython.__dedentFinallyToTry

__dedentFinallyToTry()

Private method to dedent the line of the except statement to the last try statement with less (or equal) indentation.

#### CompleterPython.__dedentToIf

__dedentToIf()

Private method to dedent the last line to the last if statement with less (or equal) indentation.

#### CompleterPython.__inComment

__inComment(line, col)

Private method to check, if the cursor is inside a comment

line
  current line (integer)
col
  current position within line (integer)

Returns:
  flag indicating, if the cursor is inside a comment (boolean)

#### CompleterPython.__inDoubleQuotedString

__inDoubleQuotedString()

Private method to check, if the cursor is within a double quoted string.

Returns:
  flag indicating, if the cursor is inside a double quoted string (boolean)

#### CompleterPython.__inSingleQuotedString

__inSingleQuotedString()

Private method to check, if the cursor is within a single quoted string.

Returns:
  flag indicating, if the cursor is inside a single quoted string (boolean)

#### CompleterPython.__inTripleDoubleQuotedString

__inTripleDoubleQuotedString()

Private method to check, if the cursor is within a triple double quoted string.

Returns:
  flag indicating, if the cursor is inside a triple double quoted string (boolean)

#### CompleterPython.__inTripleSingleQuotedString

__inTripleSingleQuotedString()

Private method to check, if the cursor is within a triple single quoted string.

Returns:
  flag indicating, if the cursor is inside a triple single quoted string (boolean)

#### CompleterPython.__isClassMethod

__isClassMethod()

Private method to check, if the user is defining a class method.

Returns:
  flag indicating the definition of a class method (boolean)

#### CompleterPython.__isClassmethodDef

__isClassmethodDef()

Private method to check, if the user is defing a classmethod (@classmethod) method.

Returns:
  flag indicating the definition of a classmethod method (boolean)

#### CompleterPython.charAdded

charAdded(charNumber)

Public slot called to handle the user entering a character.

charNumber
  value of the character entered (integer)

#### CompleterPython.readSettings

readSettings()

Public slot called to reread the configuration parameters.

Up