JetBrains Fleet 1.41 Help

List of Python postfix completion templates

This table summarizes the postfix completion templates that you can use with your Python code.

Name

Description

Example. Before

Example. After

enum

Iterates over the enumeration of the expression as source in the for statement.

def f(a): a.enum
def f(a): for i, e in enumerate(a):

for

Iterates over the expression as source in the for statement.

def f(a): a.for
def f(a): for i in a:

fore

Iterates over the enumeration of the expression as source in the for statement.

def f(a): a.enum
def f(a): for i, e in enumerate(a):

if

Uses the expression as a condition in the if statement.

def f(a): a.if
def f(a): if a:

ifn

Checks if the expression is None.

def f(a): a.ifn
def f(a): if a is None:

ifnn

Checks if the expression is not None.

def f(a): a.ifnn
def f(a): if a is not None:

iter

Iterates over the expression as source in the for statement.

def f(a): a.for
def f(a): for i in a:

itere

Iterates over the enumeration of the expression as source in the for statement.

def f(a): a.enum
def f(a): for i, e in enumerate(a):

len

Converts postfix .len calls to len calls.

def f(a): a.len
def f(a): len(a)

main

Surrounds the current statement with the if __name__ == '__main__:' expression.

abs(1).main
if __name__ == '__main__': abs(1)

not

Negate the expression.

def f(a): return a.not
def f(a): return not a

par

Encloses the selected expression in parentheses.

def f(): a = 1, 2.par return a
def f(): a = (1, 2) return a

print

Surrounds the expression with the print function for Python 3 or with the print statement for Python 2.

a.print
print(a)

return

Returns a value of the containing method.

def f(): a = 1 a.return
def f(): a = 1 return a

while

Uses the expression as condition in the while statement.

def f(a): a.while
def f(a): while a:
Last modified: 11 February 2024