I think there was an error when translating this doc from python 2 to python 3. Now it is invalid for both. I've raised the issue to the maintainer when you posted this issue on our forums.
For python 2, you only need to remove the parenthesis around the print statement or import print_function
from __future__
.
from __future__ import print_function
def print_result((key, metadata, record)):
print(key, metadata, record)
Python 3 removed support for tuple parameter unpacking (PEP 3113). So to fix this for python 3 you just need to remove the tuple parameter unpacking:
def print_result(args):
key, metadata, record = *args
print(key, metadata, record)