blob: e03b8e9bd366e21ada0b71957a1a474cfeb25cc1 [file] [log] [blame]
Tor Norbye3a2425a2013-11-04 10:16:08 -08001def foo(bar):
2 pass # nothing
3
4def __call__(foo):
5 pass # nothing, out of class
6
7def innocent(f):
8 "innocent deco"
9 return f
10
11class Foo(object):
12
13 def __init__(<weak_warning descr="Usually first parameter of a method is named 'self'">a</weak_warning>, b):
14 pass # rename a
15
16 def foo<error descr="Method must have a first parameter, usually called 'self'">()</error>:
17 pass # propose self
18
19 def loo<weak_warning descr="First parameter of a non-static method must not be a tuple">((l, g), *rest)</weak_warning>:
20 pass # complain at tuple
21
22 def zoo(*animals):
23 pass # nothing
24
25 def __new__(<weak_warning descr="Usually first parameter of such methods is named 'cls'">self</weak_warning>):
26 pass # propose cls
27
28 @classmethod
29 def boo(<weak_warning descr="Usually first parameter of such methods is named 'cls'">self</weak_warning>):
30 pass # propose cls
31
32 @classmethod
33 @innocent
34 def boo(<weak_warning descr="Usually first parameter of such methods is named 'cls'">self</weak_warning>):
35 pass # propose cls
36
37 @innocent
38 @classmethod
39 def boo(<weak_warning descr="Usually first parameter of such methods is named 'cls'">self</weak_warning>):
40 pass # propose cls
41
42 @staticmethod
43 def moo(a):
44 pass # nothing
45
46 @staticmethod
47 def qoo((x, y, z), t):
48 pass # nothing
49
50 @staticmethod
51 @innocent
52 def qoo((x, y, z), t):
53 pass # nothing
54
55 @innocent
56 @staticmethod
57 def qoo((x, y, z), t):
58 pass # nothing
59
60class Meta(type):
61
62 def foo(<weak_warning descr="Usually first parameter of such methods is named 'self'">first</weak_warning>): # rename to "self"
63 pass
64
65 def __new__(<weak_warning descr="Usually first parameter of such methods is named 'mcs'">self</weak_warning>, *rest): # rename to "mcs"
66 pass
67
68 def __call__(<weak_warning descr="Usually first parameter of such methods is named 'cls'">self</weak_warning>): # rename to "cls"
69 pass
70
71 def bar(cls): # <- rename to "self"
72 return "foobar"
73
74 @classmethod
75 def baz(<weak_warning descr="Usually first parameter of such methods is named 'mcs'">moo</weak_warning>): # <- rename to "mcs"
76 return "foobar"
77
78 @staticmethod
79 def bazz(param1):
80 return "foobar"