Search code examples
pythonsyntaxparentheses

Python: What do double parenthesis do?


Can anyone tell me why the parenthesis are doubled here?

self.__items.append((module, item))

Solution

  • It's passing the tuple (module, item) to the function as a single argument. Without the extra parens, it would pass module and item as separate arguments.