
April 25, 2021
10:31 p.m.
On 4/25/21 3:08 PM, Shreyan Avigyan wrote:
Thanks for clarifying. And I agree with you. Not writing checking code will make the function more flexible.
Thanking you, With Regards
My experiance is that the type annotaions let my IDE warn me of wrong parameters, or give me hints as to what type it wants. I generally don't need to explicitly test the type, as if it is of the wrong type (at least a wrong type of duck) then it will throw an error when I do something it doesn't know how to do it. Thus, unless the exact type of exception is important (and it usually isn't) there is no need to test and throw a specific type of error. -- Richard Damon