File: test23.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 (48 lines) | stat: -rw-r--r-- 902 bytes parent folder | download | duplicates (9)
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
'doc'

class X:
    'doc'
    def __init__(self):
        self.fff = 0

    def x(self):
        pass

    def y(self):
        'should generate a warning'
        if self.x:
            pass
        if self.x and globals():
            pass
        if globals() and self.x:
            pass

    def z(self):
        'should NOT generate a warning'
        if globals() :
            pass
        if self.x() and self.fff:
            pass
        if self.x() and globals():
            pass
        if globals() and self.x():
            pass
        if self.fff:
            pass
        print self.x
        print self.fff

class Y(X):
    'doc'
    def j(self):
        'should generate a warning'
        if self.x:
            pass
        print self.fff

    def h(self):
        'should NOT generate a warning'
        if self.x():
            pass
        print self.x
        print self.fff