config_defaults
is a dict
that has tuples as keys.And in this line
value = config_defaults[section, option]
section, option
part is implicit tuple, so it's a valid code, effectively the same as value = config_defaults[(section, option)]
.from the docs:
Quote:output tuples are always enclosed in parentheses, so that nested tuples are interpreted correctly; they may be input with or without surrounding parentheses, although often parentheses are necessary anyway (if the tuple is part of a larger expression).
>>> foo = 'spam', 'eggs' >>> foo ('spam', 'eggs') >>> type(foo) <class 'tuple'> >>>also, another example:
some_dict = {(1, 2):'one', (3, 4):'two'} print(some_dict[1, 2])
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs