~ubuntu-branches/ubuntu/trusty/pylint/trusty

« back to all changes in this revision

Viewing changes to test/input/func_use_for_or_listcomp_var.py

  • Committer: Bazaar Package Importer
  • Author(s): Sylvain Thénault
  • Date: 2006-09-25 16:46:40 UTC
  • mfrom: (1.2.1 upstream) (2.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20060925164640-obkb6g34gqtyk20n
new uptream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""test a warning is triggered when using for a lists comprehension variable"""
 
2
 
 
3
__revision__ = 'yo'
 
4
 
 
5
TEST_LC = [C for C in __revision__ if C.isalpha()]
 
6
print C # WARN
 
7
C = 4
 
8
print C # this one shouldn't trigger any warning
 
9
 
 
10
B = [B for B in  __revision__ if B.isalpha()]
 
11
print B # nor this one
 
12
 
 
13
for var1, var2 in TEST_LC:
 
14
    var1 = var2 + 4
 
15
print var1 # WARN
 
16
 
 
17
for note in __revision__:
 
18
    note.something()
 
19
for line in __revision__:
 
20
    for note in line:
 
21
        A = note.anotherthing()