Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 62)
62.
What happens if the generator.throw(ValueError, "message") method is called with a non-existent exception type?
It raises a TypeError
It raises the specified exception with the provided message
It has no effect on the running generator
It raises a GeneratorExit exception
Answer: Option
Explanation:
If the specified exception type does not exist, generator.throw() has no effect on the running generator.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.