code: def contents(self):
          r
          for content in self.all:
              is_whitespace = isinstance(content, str) and content.isspace()
              if not is_whitespace or self.preserve_whitespace:
                  yield content
docs: r"""Returns all contents in this expression.
  
          Optionally includes whitespace if set when node was created.
  
          >>> expr1 = TexExpr('textbf', ('\n', 'hi'))
          >>> list(expr1.contents)
          ['hi']
          >>> expr2 = TexExpr('textbf', ('\n', 'hi'), preserve_whitespace=True)
          >>> list(expr2.contents)
          ['\n', 'hi']