def genexprSend():
    x = ( x for x in range(9) )

    print("Sending too early:")
    try:
        x.send(3)
    except TypeError as e:
        print("Gave expected TypeError with text:", e)

    z = next(x)

    y = x.send(3)

    print("Send return value", y)
    print("And then next gave", next(x))

    print("Throwing an exception to it.")
    try:
        x.throw(2)
        assert False
    except TypeError as e:
        print("Gave expected TypeError:", e)

    print("Throwing an exception to it.")
    try:
        x.throw(ValueError(2))
    except ValueError as e:
        print("Gave expected ValueError:", e)

    try:
        next(x)
        print("Next worked even after thrown error")
    except __HOLE__ as e:
        print("Gave expected stop iteration after throwing exception in it:", e)


    print("Throwing another exception from it.")
    try:
        x.throw(ValueError(5))
    except ValueError as e:
        print("Gave expected ValueError with text:", e)
dataset/ETHPy150Open kayhayen/Nuitka/tests/basics/GeneratorExpressions.py/genexprSend