Skip to content

Commit 6eb304f

Browse files
committed
Add potential error to the unpacking arguments lecture.
1 parent cd9cb45 commit 6eb304f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

19_unpacking_arguments/code.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,13 @@ def post(url, data=None, json=None, **kwargs):
9999
"""
100100

101101
# While the implementation is irrelevant at this stage, what it allows is for the caller of `post()` to pass arguments to `request()`.
102+
103+
# -- Error when unpacking --
104+
105+
106+
def myfunction(**kwargs):
107+
print(kwargs)
108+
109+
110+
myfunction(**"Bob") # Error, must be mapping
111+
myfunction(**None) # Error

0 commit comments

Comments
 (0)