File: test87.py

package info (click to toggle)
pychecker 0.8.19-10
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,484 kB
  • ctags: 2,114
  • sloc: python: 9,968; sh: 98; makefile: 13
file content (56 lines) | stat: -rw-r--r-- 929 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
'test use of True/False'

True = 1
False = 0

true = 1
false = 0

TRUE = 1
FALSE = 0

def x(a):
    'should warn'
    if a == TRUE:
        print 'True'
    if a == TRUE or \
       a == True or \
       a == true:
        print 'True'
    if a != false:
        print 'false'
    if a is 'false':
        print 'false'
    if a is 'True':
        print 'True'
    if a is 53343:
        print '53343'
    if a is 1e7:
        print '1e7'
    if a is not 'false':
        print 'false'
    if a is not 'True':
        print 'True'
    if a is not 53343:
        print '53343'
    if a is not 1e7:
        print '1e7'

def y(a):
    'should not warn'
    if a is True:
        print 'True'
    if a is not false:
        print 'false'
    if a == 53343:
        print '53343'
    if a == 1e7:
        print '1e7'
    if a == 'TRUE' or \
       a == 'True' or \
       a == 'true':
        print 'True'

def z(a):
    return True