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 |
---|---|---|---|
| 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):
|
| Iterates over the expression as source in the for statement. |
def f(a):
a.for
|
def f(a):
for i in a:
|
| 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):
|
| Uses the expression as a condition in the if statement. |
def f(a):
a.if
|
def f(a):
if a:
|
| Checks if the expression is None. |
def f(a):
a.ifn
|
def f(a):
if a is None:
|
| Checks if the expression is not None. |
def f(a):
a.ifnn
|
def f(a):
if a is not None:
|
| Iterates over the expression as source in the for statement. |
def f(a):
a.for
|
def f(a):
for i in a:
|
| 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):
|
| Converts postfix .len calls to len calls. |
def f(a):
a.len
|
def f(a):
len(a)
|
| Surrounds the current statement with the if __name__ == '__main__:' expression. |
abs(1).main
|
if __name__ == '__main__':
abs(1)
|
| Negate the expression. |
def f(a):
return a.not
|
def f(a):
return not a
|
| Encloses the selected expression in parentheses. |
def f():
a = 1, 2.par
return a
|
def f():
a = (1, 2)
return a
|
| Surrounds the expression with the print function for Python 3 or with the print statement for Python 2. |
a.print
|
print(a)
|
| Returns a value of the containing method. |
def f():
a = 1
a.return
|
def f():
a = 1
return a
|
| Uses the expression as condition in the while statement. |
def f(a):
a.while
|
def f(a):
while a:
|