def auto_detect_serial_unix(preferred_list=['*']):
What happens to the argument when this function gets called?
def auto_detect_serial_unix(preferred_list=['*']):
What happens to the argument when this function gets called?
If nothing is passed in to auto_detect_serial_unix
, then preferred_list is set to ['*']
. Otherwise, what you pass in is set to preferred_list
:
>>> def auto_detect_serial_unix(preferred_list=['*']):
... print preferred_list
...
>>> auto_detect_serial_unix()
['*']
>>> auto_detect_serial_unix(['new', 'list'])
['new', 'list']
>>>
If auto_detect_serial_unix
is called with an argument, then preferred_list
will have the value of that argument.
Otherwise, if auto_detect_serial_unix
is called with no arguments, then preferred_list
will have the given default value.