class_docstr: Test semantics.
class_docstr_tok: ["Test","semantics","."]
docstr: Test attempting to send to non-generator
docstr_tok: ["Test","attempting","to","send","to","non-generator"]
code: def test_attempting_to_send_to_non_generator(self):
      """
      Test attempting to send to non-generator
      """
      trace = []
  
      def g():
          try:
              trace.append("starting g")
              yield from range(3)
              trace.append("g should not be here")
          finally:
              trace.append("finishing g")
  
      try:
          gi = g()
          next(gi)
          for x in range(3):
              y = gi.send(42)
              trace.append("Should not have yielded: %s" % (y,))
      except AttributeError as e:
          self.assertIn("send", e.args[0])
      else:
          self.fail("was able to send into non-generator")
      self.assertEqual(
          trace,
          [
              "starting g",
              "finishing g",
          ],
      )
  
imports: import unittest
  import inspect
  from test.support import captured_stderr, disable_gc, gc_collect
  from test import support
label_desc: Use image node_id 17 for calling the TestPEP380Operation obj's underlying member method code with example usage: obj.test_attempting_to_send_to_non_generator() without return types