File: test71.py

package info (click to toggle)
pychecker 0.8.17-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,856 kB
  • ctags: 1,896
  • sloc: python: 9,301; sh: 131; makefile: 44
file content (50 lines) | stat: -rw-r--r-- 777 bytes parent folder | download | duplicates (3)
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
'test unreachable code'

__pychecker__ = 'unreachable'

def a(x):
    if x == 5:
        return x
    return 0
    print x

def b(x):
    if x == 5:
        return x
    raise ValueError
    print x

def c(x):
    if x == 5:
        return
    return
    print x

def d(x):
    if x == 5:
        return
    raise ValueError
    print x

def e(x):
    def foo():
        print x
    foo()
    return x

def f():
    x = e(1)
    print x

class Point:
    """doc string"""
    parse = None

    def get_position(self, parts):
        try:
            return Point.parse('%s %s' % (parts[1], parts[2]), float(parts[3]))
        except ValueError, e:
            # FIXME: handle better than printing
            print 'Unable to process position report\n', e
        return None