code: def iter_fields(node):
      
      # CPython 2.5 compat
      if not hasattr(node, '_fields') or not node._fields:
          return
      for field in node._fields:
          try:
              yield field, getattr(node, field)
          except AttributeError:
              pass
docs: Iterate over all fields of a node, only yielding existing fields.