File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,15 @@ class Delegator:
19
19
>>> delegator.p2
20
20
Traceback (most recent call last):
21
21
...
22
- AttributeError: 'Delegate' object has no attribute 'p2'
22
+ AttributeError: 'Delegate' object has no attribute 'p2'. Did you mean: 'p1'?
23
23
>>> delegator.do_something("nothing")
24
24
'Doing nothing'
25
+ >>> delegator.do_something("something", kw=", faif!")
26
+ 'Doing something, faif!'
25
27
>>> delegator.do_anything()
26
28
Traceback (most recent call last):
27
29
...
28
- AttributeError: 'Delegate' object has no attribute 'do_anything'
30
+ AttributeError: 'Delegate' object has no attribute 'do_anything'. Did you mean: 'do_something'?
29
31
"""
30
32
31
33
def __init__ (self , delegate : Delegate ) -> None :
@@ -47,8 +49,8 @@ class Delegate:
47
49
def __init__ (self ) -> None :
48
50
self .p1 = 123
49
51
50
- def do_something (self , something : str ) -> str :
51
- return f"Doing { something } "
52
+ def do_something (self , something : str , kw = None ) -> str :
53
+ return f"Doing { something } { kw or '' } "
52
54
53
55
54
56
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments