| Tor Norbye | 3a2425a | 2013-11-04 10:16:08 -0800 | [diff] [blame] | 1 | <warning descr="Statement seems to have no effect">2 + 3</warning> |
| 2 | <warning descr="Statement seems to have no effect">string</warning> |
| 3 | |
| 4 | def foo(): |
| 5 | <warning descr="Statement seems to have no effect">3</warning> |
| 6 | |
| 7 | def bar(): |
| 8 | """a""" |
| 9 | <warning descr="Statement seems to have no effect">"a"</warning> |
| 10 | |
| 11 | [allpats.extend(patlist) for patlist in pats.values()] |
| 12 | |
| 13 | class Printer(object): |
| 14 | def __lshift__(self, what): |
| 15 | print what |
| 16 | |
| 17 | cout = Printer() |
| 18 | cout << "Hello, world" # must not be reported |
| 19 | |
| 20 | len(x) if True else len(y) |
| 21 | |
| 22 | (foo()) |
| 23 | |
| 24 | foo(), |
| 25 | |
| 26 | x = 3 |
| 27 | """:type: int""" |
| 28 | |
| 29 | x = 3 |
| 30 | """@type: int""" |
| 31 | |
| 32 | foo() |
| 33 | <warning descr="Statement seems to have no effect">"""fake docstring"""</warning> |
| 34 | |
| 35 | def foo(): |
| 36 | y = 2 |
| 37 | <warning descr="Docstring seems to be misplaced">"""fake docstring"""</warning> |
| 38 | |
| 39 | # PY-10755 |
| 40 | def is_good(a): |
| 41 | return a > 10 |
| 42 | |
| 43 | def do_something(a): |
| 44 | print a |
| 45 | |
| 46 | def process(): |
| 47 | for a in range(20): |
| 48 | is_good(a) and do_something(a) |