3 ms·
An error: *args arrive as a tuple, not a list, so the first line that all_the_args(1, 2, a=3, b=4) prints is not: [1, 2] but is instead (1, 2) The s
by chrismorgan 13y ago
An error: *args arrive as a tuple, not a list, so the first line that all_the_args(1, 2, a=3, b=4) prints is not:
[1, 2]
but is instead
(1, 2)
The second line of that output also happens to be wrong, because printing a dictionary uses repr() on its keys and values and str.__repr__ normally uses single quotes, so instead of
{"a": 3, "b": 4}
It will instead print
{'a': 3, 'b': 4}
For that matter, I would prefer it if this guide used single quotes primarily; that is the preferred standard in Python.