gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / pylint / test / functional / defined_and_used_on_same_line.py @ 745
History | View | Annotate | Download (676 Bytes)
1 |
"""Check for definitions and usage happening on the same line."""
|
---|---|
2 |
#pylint: disable=missing-docstring,multiple-statements,no-absolute-import,parameter-unpacking,wrong-import-position
|
3 |
from __future__ import print_function |
4 |
print([index |
5 |
for index in range(10)]) |
6 |
|
7 |
print((index |
8 |
for index in range(10))) |
9 |
|
10 |
FILTER_FUNC = lambda x: not x |
11 |
|
12 |
def func(xxx): return xxx |
13 |
|
14 |
def func2(xxx): return xxx + func2(1) |
15 |
|
16 |
import sys; print(sys.exc_info()) |
17 |
|
18 |
for i in range(10): print(i) |
19 |
|
20 |
j = 4; LAMB = lambda x: x+j |
21 |
|
22 |
FUNC4 = lambda a, b: a != b
|
23 |
|
24 |
# test http://www.logilab.org/ticket/6954:
|
25 |
|
26 |
with open('f') as f: print(f.read()) |
27 |
|
28 |
with open('f') as f, open(f.read()) as g: |
29 |
print(g.read()) |