id is a Python function, so you are overwriting it here. My proposal (without .keys() calling):

  for id_ in comments: