blob: bda25d328cd9b90c8206bc0ca454de3229c8f84c [file] [log] [blame]
Tor Norbye3a2425a2013-11-04 10:16:08 -08001def foo(a, b = 345, c = 1):
2 pass
3
4foo(1, <weak_warning descr="Argument equals to default parameter value">345</weak_warning>, 22)
5
6def foo(a = None):
7 pass
8foo(<weak_warning descr="Argument equals to default parameter value">a = None</weak_warning>)
9
10def bar(a = 2, b = 3):
11 pass
12
13#PY-3260
14bar(<weak_warning descr="Argument equals to default parameter value">a = 2</weak_warning>, <weak_warning descr="Argument equals to default parameter value">b = 3</weak_warning>)
15
16class A:
17 @classmethod
18 def foo(cls, a = 1):
19 pass
20
21a = A()
22
23a.foo(<weak_warning descr="Argument equals to default parameter value">1</weak_warning>)
24
25
26class C(object):
27 def __init__(self):
28 self._x = None
29
30 def getx(self):
31 return self._x
32 def setx(self, value):
33 self._x = value
34 def delx(self):
35 del self._x
36
37 x = property(getx, <weak_warning descr="Argument equals to default parameter value">None</weak_warning>, fdel = delx, doc = "I'm the 'x' property.")
38
39
40# PY-3455
41import optparse
42
43class Option(optparse.Option):
44 pass
45
46class OptionParser(optparse.OptionParser):
47 def __init__(self):
48 optparse.OptionParser.__init__(self, option_class=Option)
49
50##
51
52def bar(a = "qwer"):
53 pass
54
55bar(<weak_warning descr="Argument equals to default parameter value">a = 'qwer'</weak_warning>)
56
57getattr(bar, "__doc__", None) # None is not highlighted
58
59class a:
60 def get(self, a, b = None):
61 pass
62
63kw = a()
64
65kw['customerPaymentProfileId'] = kw.get("customerPaymentProfileId",
66 <weak_warning descr="Argument equals to default parameter value">None</weak_warning>)
67
68{1: 2}.get('foo', None) #pass
69{1: 2}.pop('foo', None) #pass