Python version should be here not relevant. But since the results of raising both things are the same, I want to understand, what is the practical meaning of differentiating between a ValueError and an Exception. So as I understand, an Exception is a more general term, and ValueError can be applied in some specific cases. Raised when a built-in operation or function receives an argument that has the right type but an inappropriate value, and the situation is not described by a more precise exception such as Indeċrror. Then I read the documentation of exceptions, and found the following definition of ValueError: I have made a research on this question on SO, but found no discussion on this. I have tried both in the same code (even in the same branch) and the result was the same - I got an error message. I am trying to understand what is a difference between raising a ValueError and an Exception.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |